Question: Records: Write a C++ program that can open and read data from an external data file and then display that data on the screen for

Records: Write a C++ program that can open and read data from an external data file and then display that data on the screen for viewing in the desired format. The data file contains customer information for a fictional companys records. The maximum number of records could be up to 100. From the file, in each row there is an ID number, a name and the balance due related to that specific customer. The display the program needs to output should be formatted in this particular order: ID (to be sorted in ascending order), Name, balance (from data input file) and 15% of that balance for each customer (to be calculated by the program) in a single row.

Lastly, the data displayed on-screen should also be written out to another data file for recording purposes (all columns MUST be aligned, and floating-point values should have precision set to 2, with 2 digits after the dot). Both data files are text files that could be read from Notepad, and their names (COULD HAVE MORE THAN ONE WORD WITH THE FILENAME) must be allowed to enter at the run time of the program.

Please see the examples below for formatting details

- In the data file to be read in, the data will look like the following:

77234 Ashley White# 4563.50

12345 Brad Smith# 128923.45

87123 Lisa Johnson# 2345.93

Then, on the screen AND in the file to be saved for recording purposes, the data should look like the following:

12345 Brad Smith 128923.45 19338.52

77234 Ashley White 4563.50 684.52

87123 Lisa Johnson 2345.93 351.89

Use the following sample file as input data file:

77234 Ashley White# 4563.50

72345 Brad Smith# 228923.45

87323 Lisa Johnson# 2345.93

83234 Sheila Robinson# 674.00

44444 Rita Gupta# 64863.50

23422 Ajay Kumar# 72682.90

22222 Jose Ramey# 25345.35

54234 Sheila Duffy# 65222.00

55555 Tommy Pitts# 892.85

23452 Salma Quade# 2842.90

32657 Jennifer Ackerman# 9823.89

82722 Steve Sharma# 78932.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!