Question: Write a simple java program called RainFall class that stores the total rainfall for each of 1 2 months in an array of doubles. The

Write a simple java program called RainFall class that stores the total rainfall for each of 12 months in 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. Additionally, write a separate RainFallTest class to test the RainFall class. The RainFallTest class should: Create a RainFall object with sample data for 12 months. Call each method in the RainFall class to retrieve the total rainfall, average rainfall, and the months with the highest and lowest rainfall. Display the results clearly. Demonstrate the program by running RainFallTest and observing the output.

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 Programming Questions!