Create a program uses a structure


Discuss the below:

Q: Create a program that uses a structure to store the following weather date for a particular month:

Total Rainfall
High Temperature
Low Temperature
Average Temperature

The program should have an array of 12 structures to hold weather date for an entire year. When the program runs, it should ask the user to enter date for each month. (The average temperature should be calculated.) Once the date are entered for all the months, the program should calculate and display the average monthly rainfall, the total rainfall for the year, the highest and lowest temperatures for the year (and the months they occurred in), and the average of the monthly average temperatures.
Input validation: only accept temperatures within the range between -100 and +140 degrees Fahrenheit.

Below is how the code should look like.

Enter the following information:
Month 1
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 2
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 3
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 4
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 5
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 6
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 7
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 8
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 9
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 10
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 11
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Month 12
Total Rainfall:
High Temperature:
Low Temperature:
Average Temperature:
Total Rainfall is:
Average Monthly Rain:
Average Monthly Average Temperature:
Highest Temperature:
Lowest Temperature:
Press any key to continue.........

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a program uses a structure
Reference No:- TGS01936567

Now Priced at $25 (50% Discount)

Recommended (95%)

Rated (4.7/5)