Question: Question 2:Average rainfall I 1.Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. First

 Question 2:Average rainfall I 1.Write a program that uses nested loopsto collect data and calculate the average rainfall over a period of

Question 2:Average rainfall I 1.Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. First the program should ask for the number of years. The outer loop will iterate once for each year. The inner loop williterate 12 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. Expected output of Question 2 Output - Rainfall (run) x Enter Number of Years: 1 Enter Number of Inches of Rainfall for month 1 in year 1 : 2 Enter Number of Inches of Rainfall for month 2 in year 1: 2 Enter Number of Inches of Rainfall for month 3 in year 1 : 3 Enter Number of Inches of Rainfall for month 4 in year 1: 4 Enter Number of Inches of Rainfall for month 5 in year 1: 3 Enter Number of Inches of Rainfall for month 6 in year 1 : 2 Enter Number of Inches of Rainfall for month 7 in year 1 : 2 Enter Number of Inches of Rainfall for month 8 in year 1 : 5 Enter Number of Inches of Rainfall for month 9 in year 1: 6 Enter Mis tuber of Inches of Rainfall for month 10 in year 1 : 5 Enter Number of Inches of Rainfall for month 11 in year 1 : 5 Enter Number of Inches of Rainfall for month 12 in year 1: 5 Total Months: 12 Total Rainfall: 44.0 inches Average Rainfall per month over 1 years periodo 3.6666666666666665 per month

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!