Write a RainFall class that stores the total rainfall for each of 12 months into an array of double s. 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 • Test the RainFall class by writing a tester class, RainFallDemo , to produce the outputs similar to the sample execution below. For the rainfall values, you must get them from the user’s input as double values in the tester class. For the class RainFall you must write standard Java Documentation for the whole class on the top, and for every method. Input Validation: Do not accept negative numbers for monthly rainfall figures. If a value is negative, ask the user to re-enter the input
Write a RainFall class that stores the total rainfall for each of 12 months into an array of double s. 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 • Test the RainFall class by writing a tester class, RainFallDemo , to produce the outputs similar to the sample execution below. For the rainfall values, you must get them from the user’s input as double values in the tester class. For the class RainFall you must write standard Java Documentation for the whole class on the top, and for every method. Input Validation: Do not accept negative numbers for monthly rainfall figures. If a value is negative, ask the user to re-enter the input.

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









