Question
In JAVA: How do I create an array based on user input? Specfically I need to create an array that stores the amount of rainfall
In JAVA: How do I create an array based on user input? Specfically I need to create an array that stores the amount of rainfall for each month of the year. The program will ask the user for the rainfall for each month and store the data in the array.
Inside the main() method, first you will get the rainfall data for each of the 12 months in 2016 from the user and stores them in a double array. Next, you will need to design the following four value-returning methods that compute and return to main() the totalRainfall, averageRainfall, driestMonth, and wettestMonth. The last two methods return the index (or number) of the month with the lowest and highest rainfall amounts, not the amount of rain that fell those months. Notice that this month index (or number) can be used to obtain the amount of rain that fell those months.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started