Question: 10. Average Rainfall (8 points) Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years.

 10. Average Rainfall (8 points) Write a program that uses nested

10. Average Rainfall (8 points) 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 less than I for the number of years. eriod of years. How many years do you wish to average? umber of inches of rain For month 1P umber of inches of rain for msonth 3P umber of inches of rain for sonth6 Nmber of isches of rain for month 2 unber of inches of rain for sonth 4P umber of inches of rain for sonth 5 4 of inches of raim fer month 73 of inches of rain fer month ? 2 of inches of rain for sonth 9 4 for month 1? 5 of inches of rain for meeth 11 uber of inches of rain for month 12? 7 inches of rain for month 2P of inches of inches of inches ef of isches of rain fer month 12 Over peried of 24 CBoO F3 F5 P11 F7

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!