Question: In Java Write a class Rainfall that scores the total rainfall for each of 12 months into an array doubles. The program should have methods

In Java

Write a class Rainfall that scores the total rainfall for each of 12 months into an array doubles. The program should have methods that return the following The total rainfall for the year The average monthly rainfall The month with most rain The month with least rain

Sample rainfall is double[] thisYear = {1.6, 2.1, 1.7, 3.5, 2.6, 3.7, 3.9, 2.6, 2.9, 4.3, 2.4, 3.7 };

Output The total rainfall for this year is 35.0 The average rainfall for this year is 2.9166666666666665 The month with the highest amount of rain is 10 with 4.3 inches. The month with the lowest amount of rain is 1 with 1.6 inches.

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!