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

1 Expert Approved Answer
Step: 1 Unlock

The Rainfall class should have an array of 12 doubles which will store the total rainfall for each m... View full answer

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 Starting Out With Java From Control Structures Questions!