Your task is to read the records in from the data file (cb1data.txt) and produce a report to a file named cbreport.txt.
Although the following technique is "brittle", you may read the data from the input file using the standard input extraction operator. For example, if you wanted to read one whole record in one statement and had the appropriate variables declared, you could write:
infile >> dept >> empID >> month >> day >> year >> hours;
A "priming read" is well-suited for this type of algorithm. A priming read makes a read from input just before a while loop starts, and then has the same read just before the end of the loop body. That type of read works very well when reading from a text file and checking for end-of-file. Instead of trying to read all of the fields from a single record though, it is better to just use the first field for the priming read, and read the remainder of the fields for that record as the first line within the loop. Example:
The report you produce should match the sample report exactly, including ALL formatting and spacing. A sample of the report is available on the remote server at: ~dklick/examples/cbreport250.txt. You can compare your output file to the reference outout file using the following command:
diff report.txt ~dklick/examples/cbreport250.txt
That command will display differences between the two files. If there are no differences, then your report is correct.
You have been given an algorithm to implement. There are some ambiguities to simulate a real life situation - but no errors that the instructor is aware of. You are required to use ostream manipulators (left, right, setw, setprecision, fixed, showpoint, etc.) to get the correct output formatting for this project.