Average Rainfall

i have been reading my book and looking online but it is easier said and done when it comes to this assignment.


For the following program, include:
a. Pseudocode
b. Algorithm
c. Program code

Save your work in your homework/homework4 folder as rainfallalg.txt and rainfall.cpp.

Average Rainfall
Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month.

After all iterations, the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period.

***Input validation: Do not accept a number of less than 1 for the number of years. Do not accept negative numbers for the monthly rainfall.

Grading Rubric:
Algorithm (10) _____
Input Validation (3) _____
Loops (7) _____
Overall Accuracy (5) _____

· organization
· use of variables
· input statements
· output statements
· calculations
· counters
Please at least attempt the assignment first.
Last edited on
What? Do you expect us to write it for you?
Topic archived. No new replies allowed.