Question: Write a C + + program that will use a structure called weatherData to store the following information: Total Rainfall ( in inches ) High
Write a C program that will use a structure called weatherData to store the
following information:
Total Rainfall in inches
High Temperature in Fahrenheit
Low Temperature in Fahrenheit
Average Temperature in Fahrenheit
Your program should have an array of type weatherData of size to store
weather data for each of the months of the year. The data for each month
should be read from a file at the beginning of the program to populate each value
of the array. This task should be done in a function. Input file will be provide.
In addition, the following should be calculated and displayed in your program they
should be done in functions
Average monthly rainfall
Total rainfall for the year
Highest temperature
Lowest temperature
Your output should consist of this heading:
Month name, Total Rainfallinches Highest Temp, Lowest Temp, Average Temp.
Then followed with the month name and data read from file. Example:
January,
February,
etc
Note: You should have an array of month names to make it easy for you to print
the names of the months.
Lastly, followed by the following output of texts followed by values obtained
earlier in your program:
Average monthly rainfall :
Lowest temperature :
You should do this task in a function
Average rainfall, Highest Temp, Lowest Temp, Average Temp
The first line of the abovementioned file is a description only. Read it but don't process it Also, the data shown in the file all madeup data they are there only to serve our purpose of reading and process a file When reading the screenshot of the infile please ignore chat, strings or any other data type that will not be saved to the array, no vectors please, I will upvote no problem as long as it works having trouble with this assignmentI will use notepad from windows to create identical file to this for testing, if that helps Thanks in advancement
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
