Question: Java program does the following Rainfall Amounts (RainfallAmounts.javal Create a program that prompts the user to enter rainfall amounts (in inches) for 12 months of

Java program does the following
 Java program does the following Rainfall Amounts (RainfallAmounts.javal Create a program

Rainfall Amounts (RainfallAmounts.javal Create a program that prompts the user to enter rainfall amounts (in inches) for 12 months of one year The values must be stored into an (int-typed) array. Then, only after storing all 12 values to the array, you program will use the data contained in the array to determine and print: The total rainfall . . The average monthly rainfall (Rounded to two decimal places.) The month with the most rain . . The month with the least rain If the user enters a negative number for a month, keep prompting the user to re-enter a non-negative value for the month. Sample Input/Output Please enter the rainfall amount for month 1: 5 Please enter the rainfall amount for month 2: 4 Please enter the rainfall amount for month 3: 3 Please enter the rainfall amount for month 4: 2 Please enter the rainfall amount for month 5:1 Please enter the rainfall amount for month 6: 0 Please enter the rainfall amount for month 7: -6 Invalid amount. Try again. Please enter the rainfall amount for month 7:-2 Invalid amount. Try again. Please enter the rainfall amount for month 7: 2 Please enter the rainfall amount for month 8: 3 Please enter the rainfall amount for month 9: 4 Please enter the rainfall amount for month 10: S Please enter the rainfaii amount for month 11: 6 Please enter the rainfali amount for month 12: 7 The total rainfall is 2 inche The average monthly rainfall 2.5 3.50 inches The month with the most rain was monch 12. The month with the least rain was month 6 Be sure to use comments to document your code

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!