Answer to Question #5088 in C++ for aiman

Question #5088
how to calculate average temperature of a year including the index by using arrays 2-dimensional
1
Expert's answer
2011-11-15T08:02:34-0500
create 2-dimensional array, where first - day in month and second - day in month
and fill with its values.
float ar[31][12];
then calculate average
temperature:
for (int i=0;i<31;i++){
for (int
j=0;j<12;j++){
Sum=Sum+ar[i,j];
k++;
}
}
average=Sum/k;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS