Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that asks the user to enter daily rainfall amounts. Your program will need to accept 20 daily rainfall inputs. Only allow non-negative
Write a program that asks the user to enter daily rainfall amounts. Your program will need to accept 20 daily rainfall inputs. Only allow non-negative rainfall amounts. When the user enters a negative number, tell them that the number is invalid, and that they should enter another, valid value.
Calculate the total rainfall and the average rainfall. Determine the largest daily rainfall and the smallest daily rainfall.
Output the total, average, largest, and smallest values using informative messages.
The following things cannot happen in main:
- Accepting user input
- Calculation of total or average
- Determination of largest or smallest
- Outputting results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started