Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions