Question
Write a flowchart that reads an input file that contains two fields from any number of records .(Could be thousands!) The first field contains a
Write a flowchart that reads an input file that contains two fields from any number of records.(Could be thousands!) The first field contains a number from 1-7. 1 represents Monday, 2 - Tuesday and so forth thru 7 with represent Sunday. The second field on each record will be a temperature for that day of the week. (There will be multiple records for each day of the week and can be in any order in the input file.)
Example of fields names for each record of the input file;
DOW TEMP These names are not in the file!
Example of possible records from input file;
1 62
2 54
7 55
6 77
1 55
continues on with any amount of records....could be a few or thousands!
Assume that all input records will contain valid information.
Temps could be negative.
YOU CAN ONLY READ THROUGH THE FILE ONCE!
Your program will find the High, Low and Average Temperature for each day of the week. Then it should write out a new record to an output file for each day of the week. (The output file will only contain 7 records. One for each day of the week.) Each output record will contain these fields; DOW, HighTemp, LowTemp, AverageTemp. (These are field names and not in the file.) Also include in your program status output displays to the screen to indicate when the program has started and ended. Example:
DOW Temperature Started. Please wait....
DOW Temperature Completed Successfully.
Example of fields names contained in each record;
DOW HIGH LOW AVERAGE
(These are not in the file!)
Example of possible values that might be contained in an output record;
1 78 66 70
2 87 77 81
3 70 80 75
4 0 0 0
Etc....
The output file MUST contain 7 records. One record for each day of the week! Put 0 for the high, low and average if no records were found in the input file for that day of the week.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started