CH11_4
http://www.chegg.com/homework-help/questions-and-answers/question-please-help-question-write-program-uses-structure-store-following-weather-data-pa-q3363800
https://www.daniweb.com/software-development/cpp/threads/395877/weather-structure-program
https://www.daniweb.com/software-development/cpp/threads/395877/weather-structure-program
// This program collects the weather statistics for a year. The data it collects is total rainfall, high temp, low temp, average temp.//Programming Challenge 11.4#include <iostream>#include <string>#include <iomanip>using namespace std;struct Weather{double rainfall;double high_temp;double low_temp;double avg_temp;};// Function Prototypes/*double getTotalrain(double);double getAvgrain(double);double getAverageTemp(double);double getHighTemp(double);double getLowTemp(double);*/int main(){const int NUM_MONTHS = 12; //Number of MonthsWeather months[NUM_MONTHS]; //Array of 12 monthsint index; //Loop counterdouble annualRainfall=0.0,averageRainfall;// Get rainfall for each month.for (int index = 0; index < NUM_MONTHS; index++){// Get months rainfallcout << "Enter the rainfall in inches for month #:";cout << (index + 1) << ": ";cin >> months[index].rainfall;cout<<months[index].rainfall;annualRainfall+=months[index].rainfall;averageRainfall=annualRainfall/12;}// Display total rainfall.cout << "The total rainfall for the year is ";cout << annualRainfall<< " inches." << endl;// Display the average rainfall from the yearcout << "The average rainfall for the year is ";//float average = months[index].rainfall / 12;cout << averageRainfall << " inches." << endl;cin.get();return 0;