Question: C + + ONLY The data in file Income.csv represents the average annual income by state for the years 2 0 1 6 - 2
C ONLY
The data in file Income.csv represents the average annual income by state for the years
In addition to the average salaries, the data contains a state name and a
ranking based on the salaries.
The first program PGMcpp will read the data from the file Income.csv and create
an output binary file called Income.dat. You must create an instance of a struct like the
one listed below to store each record before writing that struct instance to the output file.
Display each record read including the record number in the file as the output shows
below this is the result of the input file containing only the first five records
A second program PGMcpp will read the binary file Income.dat and create a
report that is written to a text file called Report.txt The Report.txt file should resemble
the format below. Please take the time to align the data as shown.
In this program you must assign a state number which is the position the record is in the
file. You will need to determine and print a total line for the USA that will contain the
average for each year. In this case the average will not have any decimal positions, but
must be calculated with rounding.
The Report.txt file format is this is the result of the input file containing only the first
five records:
Include a query of the data by prompting the user to enter a state number. Edit the user
input for numbers outside the range of Zero is the sentinel value that ends the
program. Using random access to the binary file, find the data for the state requested.
The following is a typical script. This data should be displayed on the console, not in the
Report.txt file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
