Rainfall Averaging

From CompSciWiki
Revision as of 14:10, 11 April 2010 by ChristopherJ (Talk | contribs)

Jump to: navigation, search

Back to the Program-A-Day homepage

Problem

Using nested loops, calculate the average rainfall across Canada on a given week. This will be done using three arrays. One representing Winnipeg, Vancover, and Halifax. Since we will not be covering arrays for another couple weeks you will need to read ahead to complete this problem. Here are the arrays to use to get you started.

int winnipeg[] = {10,0,20,4,30,60,0};
int vancover[] = {60,70,100,40,30,50,80};
int halifax[] = {0,0,0,0,0,0,0};
 

Getting Started

Wiki loops01.jpg

Solution

Code

Solution Code

Back to the Program-A-Day homepage