Question: Weather Statistics Please write a program about Weather Statistics. This program uses a structure named WeatherInfo to store the following weather data for a particular

Weather Statistics

Please write a program about Weather Statistics. This program uses a structure named WeatherInfo to store the following weather data for a particular month

totalRainfall (datatype: double)

highTemperature (datatype: double)

lowTemperature (datatype: double)

averageTemperature (datatype: double)

The program uses an array of 12 structures to hold weather data for an entire year. When the program runs, it asks the user to enter data (totalRainfall, highTemperature, lowTemperature) for each month. (The averageTemperature should be calculated) 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, the highest and lowest temperatures for the year and (the months they occurred in), and the average of all the monthly average temperatures.

Note: the temperature should be in the range [-100, 140]

When user input high temperature and low temperature for each month, the high temperature should be higher or equal to low temperature, if not, the program will display ERROR: high temperature should be higher or equal to the low temperature and asks user to input high temperature and low temperature again, if the new high temperature is still lower than the low temperature, the program will display ERROR: high temperature should be higher or equal to the low temperature and asks user to input high temperature and low temperature again, until the current high temperature is higher or equal to the low temperature, the program will continue to execute the next statement.

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!