//Natalie Zarate CSC 5 Chapter 11, P.646 #4
#include <iostream>
using namespace std;
// Prototype for GetWeatherInfo
void GetWeatherInfo(Weather month[],int num);
// Prototype for TempValid
void TempValid(Weather month[], int num);
int main()
{
struct Weather
{
float totalRain;
float tempHigh;
float tempLow;
float temp_avg;
};
months = 12;
Weather month[months];
// Call GetWeatherInfo
GetWeatherInfo(month, months);
return 0;
}
void GetWeatherInfo (Weather month[],int num )
{
for (int i = 0; i < num; i++)
{
// Prompt for total rainfall in month
cout <<"Enter the total rainfall for Month " << i + 1 << ":" << endl;
cin >> month[i].totalRain;
// Prompt for highest temp for month
cout << "Enter highest temperature for Month " << i + 1 << ": " << endl;
cin >> month[i].tempHigh;
// Call TempValid
TempValid(month, num);
// Prompt user for lowest temp for month
cout << "Enter lowest temperature for Month " << i + 1 << ": " << endl;
cin >> month[i].tempLow;
// Prompt user for average temperature for month
cout << "Enter average temperture for Month " << i + 1 << ": " << endl;
cin >> month[i].temp_avg;
}
}
void TempValid(Weather month[], int num)
{
if ()
}
Ly9OYXRhbGllIFphcmF0ZSAgICAgICAgICAgICAgICAgICAgQ1NDIDUgICAgICAgICAgICAgICAgICAgQ2hhcHRlciAxMSwgUC42NDYgIzQKI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8gUHJvdG90eXBlIGZvciBHZXRXZWF0aGVySW5mbwp2b2lkIEdldFdlYXRoZXJJbmZvKFdlYXRoZXIgbW9udGhbXSxpbnQgbnVtKTsKCi8vIFByb3RvdHlwZSBmb3IgVGVtcFZhbGlkCnZvaWQgVGVtcFZhbGlkKFdlYXRoZXIgbW9udGhbXSwgaW50IG51bSk7CgppbnQgbWFpbigpIAogewogCXN0cnVjdCBXZWF0aGVyCiAJewogCQlmbG9hdCB0b3RhbFJhaW47CiAJCWZsb2F0IHRlbXBIaWdoOwogCQlmbG9hdCB0ZW1wTG93OwogCQlmbG9hdCB0ZW1wX2F2ZzsKIAl9OwogCW1v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