Question: 10 0 0 0 0 We are tasked with developing a system that records and manages rainfall data. The system will track one year's

10 0 0 0 0 We are tasked with developing a systemthat records and manages rainfall data. The system will track one year'sdata, with individual numbers for each month. Tasks Task 1: The system

10 0 0 0 0 We are tasked with developing a system that records and manages rainfall data. The system will track one year's data, with individual numbers for each month. Tasks Task 1: The system will ask the user to enter an integer for each of the twelve months in order, with a message that lets the user know the name of the month that the data is for. If the user wishes to cancel this input process, they can enter "x" instead of an integer. Complete the method public static boolean addRainfallData to complete this task. See the method comments for more detail. Task 2: The system will compute and return the average rainfall. Complete the method public static double averageRainfall to complete this task. See the method comments for more detail. Task 3: The system will determine and return the numeric value of the lowest rainfall of the twelve collected. Complete the method public static int lowestRainfallAmount to complete this task. See the method comments for more detail. Task 4: The system will determine and return the name of the month with the lowest rainfall of the twelve collected. Complete the method public static String lowestRainfallMonth to complete this task. See the method comments for more detail. Task 5: The system will determine and return the numeric value of the highest rainfall of the twelve collected. Complete the method public static int highestRainfallAmount to complete this task. See the method comments for more detail. Task 6: The system will determine and return the name of the month with the highest rainfall of the twelve collected. Complete the method public static String highestRainfallMonth to complete this task. See the method comments for more detail. Testing > > You can use the statements in the main method to test your implementation. Data 1 to 3 shows input values you can use and the expected output for each method based on the input data used. We will test your assignment on a (set of) different data, so it is NOT sufficient to simply return these results in all cases! Sample Output Using data3 Please enter an integer for the rainfall data for January or enter x to stop 15 Please enter an integer for the rainfall data for February or enter x to stop 20 Please enter an integer for the rainfall data for March or enter x to stop 8 Please enter an integer for the rainfall data for April or enter x to stop 0 Please enter an integer for the rainfall data for May or enter x to stop 12 Please enter an integer for the rainfall data for June or enter x to stop 30 Please enter an integer for the rainfall data for July or enter x to stop 5 Please enter an integer for the rainfall data for August or enter x to stop 22 Please enter an integer for the rainfall data for September or enter x to stop 12 Please enter an integer for the rainfall data for October or enter x to stop 7 Please enter an integer for the rainfall data for November or enter x to stop 10 Please enter an integer for the rainfall data for December or enter x to stop 2 The average rainfall for the year was 11.916666666666666 inches. The lowest rainfall recorded for any month was 0 inches The name of the month with the lowest recorded rainfall was April The highest rainfall recorded for any month was 30 inches The name of the month with the highest recorded rainfall was June /** *We are tasked with developing a system that tracks the rainfall in a region for a year. * The total rainfall for each month is stored in a integer array. January's total rainfall * is stored in the first index position of the array, February's total rainfall is in the second index position of the array, etc. * *Because our RainfallTracker will be used by another system, we must use the methods exactly as defined * */ package assignment; import java.util.Scanner; public class RainfallTracker { public static void main(String[] args) { //Main is only for testing your code. //We will test your assignment on a (set of) different data, so it is NOT sufficient to simply return these results in all cases! /* * Data you can use to test your assignment *datal: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 * data2: 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 *data3: 15, 20, 8, 0, 12, 30, 5, 22, 12, 7, 10, 2 */ addRainfallData(); System.out.println("The average rainfall for the year was "+average Rainfall()+" inches."); //answers: data1:6.5, data2:6.5, data3:11.91666.... System.out.println("The lowest rainfall recorded for any month was "+lowestRainfallAmount ()+" inches"); //answers: data1:1, data2:1, data3:0 System.out.println("The name of the month with the lowest recorded rainfall was "+lowestRainfallMonth()); //answers: data1: January, data2: December, data3:April System.out.println("The highest rainfall recorded for any month was "+highestRainfallAmount()+" inches");//answers: data1:12, data2:12, data3:30 System.out.println("The name of the month with the highest recorded rainfall was "+highestRainfallMonth()); //answers: datal: December, data2: January, data3: June } /** * This method computes the average rainfall for the year. Use a for loop * Recall that average is the sum of the array values divided by the number (count) of values. */ @return a double for the computed average public static double averageRainfall() { } /** return -1.0; * This method finds the smallest value in the rainfall array * @return the integer of the lowest rainfall in the array */ NOTE: Assume that the values in the array are all unique public static int lowest RainfallAmount() { } /** return -1; * This method finds the name of the month that matches the smallest value in the rainfall array * @return the name of the month with the lowest rainfall in the array. */ NOTE: Assume that the values in the array are all unique public static String lowest RainfallMonth() { } /** return null; * This method finds the largest value in the rainfall array * @return the integer of the largest rainfall in the array *NOTE: Assume that the values in the array are all unique */ public static int highestRainfallAmount() { } /** return -1; * This method finds the name of the month that matches the largest value in the rainfall array * @return the name of the month with the largest rainfall in the array. */ NOTE: Assume that the values in the array are all unique public static String highest RainfallMonth() { } return null; /** * This method adds rainfall values to the array. Using a while loop * present the message, e.g. "Please enter an integer for the rainfall data for January or enter x to stop" get the input from the console, if it is "x" then the loop stops and false is returned. Otherwise store the integer value in the array * - end the loop when 12 integers have been added to the array, return true. * * @return true if a value was given for all 12 months, return false use enter x to stop */ public static boolean addRainfallData() { } } return false;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

accomplish the tasks outlined you need to implement several methods in the RainfallTracker class Below is the implementation of these methods package assignment import javautilScanner public class Rai... View full answer

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 Programming Questions!