Hello I was given an assignment that was to open a binary file with records.
This is the the pseudocode
Open the file
Call the displayLogFile_binary function
Close the file
Create a global data structure to hold one data record
Repeat until EOF:
Read one data record from file directly into the data structure
Print one line of the report (use the information just written to the data structure
I don't exactly know where to start in the displayLogFile_binary, but this is pretty much the skeleton that I have right now.
day of month Integer 1 1-31
month Integer 1 1-12
year Integer 1 1900-3000
sector char 1 'N', 'S', 'E', 'W'
customer ID char 8 7 characters ending with a trailing 0
customer name char 15 14 characters ending with a trailing 0
gallons_1 double 1 number of gallons used in the 1st month
gallons_2 double 1 number of gallons used in the 2nd month
gallons_3 double 1 number of gallons used in the 3rd month
and this is the sample output
NAME ID DATE SECTOR MONTH_1 MONTH_2 MONTH_3 TOTAL AVERAGE
Baker 000-N01 05/28/2017 North 430.73 693.24 626.71 1750.68 583.56
Kimberly 387-W99 05/27/2017 East 822.42 98.55 60.68 981.65 327.22
So I know at some point, maybe when Inside the structure to find the average.