Write a program using structures to store the following weather information: Tot
ID: 3690470 • Letter: W
Question
Write a program using structures to store the following weather information:
Total Rainfall
High Temperature
Low Temperature
Average Temperature
Use an input file called input.txt to load the data to your array of 12 structures to hold the weather data (the average temperature should be calculated). Once the data for all the months is entered, the program should calculate and display the average monthly rainfall, total rainfall for the year, highest and lowest temps for the year (and the months they happen in) and the average of all the months average temperatures.
Input temps should be between -100 and +140 and and total rainfall must not be less than 0
Explanation / Answer
struct Mweather{ double totalRainfall, highTemp, lowTemp, avgTemp; }; int main(){ const int MONTHS = 12; Mweather weatherData[MONTHS]; int index; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.