Question
A weather analysis program uses the following array to storethe temperature for each hour of the day on each day of aweek. int temp[7][24]; Each row represents a day(0 = Sunday, 1 = Monday, etd.) andeach column represents a time (0 = midnight, 1 = 1 a.m.,...., 12 =noon, 13 = 1.p.m., etd.) a) write a code to find tuesdays average temperature b)write a code to fine the average weekly noontemperature A weather analysis program uses the following array to storethe temperature for each hour of the day on each day of aweek. int temp[7][24]; Each row represents a day(0 = Sunday, 1 = Monday, etd.) andeach column represents a time (0 = midnight, 1 = 1 a.m.,...., 12 =noon, 13 = 1.p.m., etd.) a) write a code to find tuesdays average temperature b)write a code to fine the average weekly noontemperature
Explanation / Answer
#include using namespace std; int main() { int temp[7][24] = {0}; //stores temperature ofthe week /* finding the average tempearature on tuesday*/ double average= 0.0; double sum=0; for(int i=0; i