Question: Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following:
• The total rainfall for the year
• The average monthly rainfall
• The month with the most rain
• The month with the least rain
Demonstrate the class in a complete program.
Input Validation: Do not accept negative numbers for monthly rainfall figures.
Step by Step Solution
3.45 Rating (174 Votes )
There are 3 Steps involved in it
The Rainfall class should have an array of 12 doubles which will store the total rainfall for each m... View full answer
Get step-by-step solutions from verified subject matter experts
