Imagine a fictitious Internet provider that keeps the following "anonymized" data about each of their customers and the services they purchase. The data is anonymous, as many modern data sets are, to...

1 answer below »

Imagine a fictitious Internet provider that keeps the following "anonymized" data about each of their customers and the services they purchase. The data is anonymous, as many modern data sets are, to allow the data to be processed with fewer privacy concerns.






























Field

Data Type
Customer IDstring
StreamingMoviesint
StreamingTVint
MultipleLinesint
MonthlyChargesdouble

The fields are formatted as follows:



Customer
IDtakes the format one letter A-Z followed by 3 numbers 0-9. For example, A123, B777, C817 are all valid Customer IDs. Be sure tovalidatethis in the input.



StreamingMovies,
StreamingTVandMultipleLinesare boolean values represented by 0 (false) or 1 (true). For example, if the customer record has '1' for a StreamingMovies value, it means the customer subscribes to the StreamingMovies service.



MonthlyChargesis a floating point value, representing the customer's monthly bill.


Write a C++ console program that prompts a user to enter attributes for three customers, and outputs the collected data in a formatted table.


Since the code block to prompt the user for attributes and store their values is to be used three times instead of just one, write ageneric
value-returningfunction to do these operations and return a 'Customer' data structure (struct). Call it
three times
from main -- once for each customer.


You may write a void function to output the result for a Customer struct, passed as a parameter to the function. Or do so in a code block in main -- your choice.


Here are the other requirements:



  1. Define a 'struct Customer' data type with the fields and types from the above table.

  2. In the output, include table column headings, correctly-spaced.

  3. The total of all column widths and the spaces separating them should not exceed 80 spaces.

  4. You can use eithercin >>for the attributes orgetline().

  5. Serializedowntocustomers.txtas the last thing that your program does. If you do this right, the file should have 15lines -- 5 for each of the 3 objects.


In this assignment your program will only be writing to a file -- not reading the data later. We're doing this to practice "serializing" the data down to a file so we can read it again in future programs.



What to Submit in Canvas


Submit your CPP for grading -- no TXT files please.


Previous Module:

Week 11 - Structured Data (Gaddis Ch. 11)" aria-describedby="msf1-previous-desc" style="color: rgb(45, 59, 69); background: rgb(245, 245, 245); border: 1px solid rgb(199, 205, 209); border-radius: 3px; transition: background-color 0.2s ease-in-out 0s; display: inline-block; position: relative; padding: 8px 14px; margin-bottom: 0px; font-size: 1rem; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; overflow: hidden; text-shadow: none; user-select: none; float: left;">Previous

Chapter 12 Slides" style="float: right;">Next
Answered Same DayApr 21, 2021

Answer To: Imagine a fictitious Internet provider that keeps the following "anonymized" data about each of...

Aditi answered on Apr 21 2021
130 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here