Question: Rainfall Averages This python program will take user input over a number of years and compute the total months, total rainfall, and average rainfall. Requirements:

Rainfall Averages

This python program will take user input over a number of years and compute the total months, total rainfall, and average rainfall.

Requirements:

1. Ask user for number of years of monthly rainfall to gather.

2. Use nested loops to gather the monthly data

3. The outer loop will iterate once for every year

4. The inner loop will iterate for 12 months which asks for inches of rain for each month.

5. Must pass the test cases below.

6. Output style should be similar to test cases. Output should be clean and easy to read.

Test Cases:

How many years to gather data?: 2

Year: 1

Rainfall for month 1?: 1

Rainfall for month 2?: 2

Rainfall for month 3?: 3

Rainfall for month 4?: 4

Rainfall for month 5?: 5

Rainfall for month 6?: 6

Rainfall for month 7?: 7

Rainfall for month 8?: 8

Rainfall for month 9?: 9

Rainfall for month 10?: 10

Rainfall for month 11?: 11

Rainfall for month 12?: 12

Year: 2

Rainfall for month 1?: 1

Rainfall for month 2?: 2

Rainfall for month 3?: 3

Rainfall for month 4?: 4

Rainfall for month 5?: 5

Rainfall for month 6?: 6

Rainfall for month 7?: 7

Rainfall for month 8?: 8

Rainfall for month 9?: 9

Rainfall for month 10?: 10

Rainfall for month 11?: 11

Rainfall for month 12?: 12

Total Months: 24

Total Rainfall: 156.0

Average Rainfall :6.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!