#include #include #include class Reading { public: int lat; float temp; //all temperatures are init to -999= NO DATA Reading() {temp=-999;}; }; main() { Reading north[91],south[91]; float temp=0,totSouth=0, totNorth=0; int i=0, lat=0,total=0; //assign values to latitude for(;i<91;i++) north[i].lat=south[i].lat=i; //Input values while(1) { cout << "\nEnter Latitude (-90 to 90): "; cin >> i; cout << "Enter Temperature: "; if (i<0 && i>-91) {south[abs(i)].lat=i;cin >> south[abs(i)].temp;} else if (i>0 && i<91) {north[i].lat=i; cin >> north[i].temp;} else break; } //Print values for(i=0;i<91;i++) { cout << "\n" << "South Lat =" << i*-1 << " Temperature ="; if (south[i].temp==-999) cout << "NO DATA"; else cout << south[i].temp; cout << " North Lat =" << i <<" " << " Temperature="; if (north[i].temp==-999) cout << "NO DATA"; else cout << north[i].temp; } for(i=0;i<91;i++) { if (int(south[i].temp)!=-999 && int(north[i].temp)!=-999) { totSouth+=south[i].temp; totNorth+=north[i].temp; total++; } } if (total) {totNorth=totNorth/total;totSouth=totSouth/total;} cout << "\n" << "Average North Temp=" << totNorth; cout << "\n" << "Average South Temp=" << totSouth; if (totNorth>totSouth) cout << "\nNorth Is warmer \n"; else if (totNorth