Question: Weather Stats Write a program that defines a structure name WeatherStats to store the following weather data for a particular month having the following member

Weather Stats
Write a program that defines a structure name WeatherStats to store the following weather data for a particular month having the following member variables (or fields):
Total_Rainfall as double
Total_Snowfall as double
High_Temperature as double
Low_Temperature as double
Average_Temperature as double
The program's main function must have an array of 12 structures to hold weather data for an entire year. When the program runs, have it ask the user to enter data for each month. The average temperature for the month must be calculated as:
(High_Temperature + Low_Temperature)/2.0
WARNING: Do not allow the user to enter data for the average - your score will be significantly reduced if you do not follow this requirement.
Once the data are entered for all the months, the program should calculate and display the average monthly rainfall, the total rainfall for the year, average monthly snowfall, the total snowfall for the year, the highest and lowest temperatures for the year (and the months they occurred in - must display all occurrences), and the average of all the monthly average temperatures.
Input Validation: Only accept temperatures within the range between -150 and +150 degrees Fahrenheit. Only accept rainfall and snowfall amounts greater than or equal to zero.
To be submitted:
C++ source code file (.cpp file) of your program .
 Weather Stats Write a program that defines a structure name WeatherStats

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!