A weather analysis program uses the following array to store the temperature for each hour
of the day on each day of a week.

int temp[7][24];

Each row represents a day (0 = Sunday, 1 = Monday, etc.) and each column represents a time (0 =
midnight, 1 = 1 a.m...., 12 = noon, 13 = 1 p.m., etc.).
A) Write code to find Tuesday’s average temperature.
B) Write code to find the average weekly noon temperature.

What i have so far.. Any help?

#include <iostream>

using namespace std;


int main()
{
    int temp[7][24]; 
    int tuesday = 2, noon = 12; 
    int tuesday_total = 0, tuesday_average; 
    int noon_total=0, noon_average; 

    for (int i = 0; i<24; i++) 
    { 
        tuesday_total += temp[tuesday][i]; 
    } 
    tuesday_average = tuesday_total/24; 
    cout<<"Average for tuesday is: "<<tuesday_average<<endl;

    for (int i=0; i<7; i++)
    { 
        noon_total += temp[i][noon]; 
    } 
    noon_average = noon_total/7;

i want the coding for this question....????
read five(5) integer values values and total them using for loop.Display total as an Output of the program.
a) write the C program code for the problem?
b) Draw the flowchart to solve the problem?
This the question?

i want the coding for this question....????
read five(5) integer values values and total them using for loop.Display total as an Output of the program.
a) write the C program code for the problem?
b) Draw the flowchart to solve the problem?
This the question?

This article has been dead for over six months. Start a new discussion instead.