Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

RainFall class

RainFall class<span< h1=””>

style=”color:rgb(34,34,34);background-color:transparent;”> that has the following field:

• an array of doubles that stores the rainfall for each of the 12 months of

the year (where the first index corresponds with January, the second with

February, etc.)

The class should also have the following methods:

• a method that returns the total rainfall for the entire year

• a method that returns the average monthly rainfall for the year

• a method that returns the month with the most rain as a string

• a method that returns the month with the least rain as a string

Demonstrate the class in a program that takes 12 doubles from the user (take the

doubles in the order of the months of the year, the first corresponding to the

rainfall in January, etc.). Do input validation: if the user inputs a negative

number, ignore it and continue asking them for input until you have 12

nonnegative doubles.

Once the user has given you all 12 doubles, create instance of the RainFall

class and call its methods, printing out the total rainfall, the average

monthly rainfall, the month with the most rain, and the month with the least

rain, each on a separate line.

</span<>

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"