10 0 0 0 0 We are tasked with developing a system that records and manages...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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; 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;
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Measurement Theory In Action
ISBN: 9780367192181
3rd Edition
Authors: Kenneth S Shultz, David Whitney, Michael J Zickar
Posted Date:
Students also viewed these programming questions
-
I need some help and explanation will be a text-based .cpp file including your C++ program and a text-based .sql file including your Oracle stored procedures for the Database Application ....
-
The CEO of Amazon, has publicly questioned the advisability of granting patents for business processes such as his companys 1-Click ordering process. Do such patents put a chilling effect on the...
-
Chadwick Shoe Co. produces and sells an excellent-quality walking shoe. After production, the shoes are distributed to 20 warehouses around the country. Each warehouse services approximately 100...
-
Use the basic integration rules to find or evaluate the integral. | xe5-x dx
-
Aaron Reed, a photographer, was in a dispute with Ezelle Investment Properties, Inc., over Ezelle allegedly using one of Reeds photographs without permission. Reed sent Ezelle a cease-and-desist...
-
Preparing a Bank Reconciliation and Related Journal Entries The bookkeeper at Wood Company has not reconciled the bank statement with the Cash account, saying, I dont have time. You have been asked...
-
(1 point) A local polka band wants to make and sell CDs of its songs. Suppose it costs $ 1000 to record, S 450 to edit, and S 350 for album artwork, and suppose each CD that is manufactured will cost...
-
4.2 The input-output curve of a gas-fired generating unit is approximated by the following function: H(P) = 120 +9.3P+0.0025P (MJ/h) This unit has a minimum stable generation of 200 MW and a maximum...
-
Scenario: The manager of the workplace call centre has come to you, the HR advisor, because they have identified a 'problem' employee. This employee, according to the supervisor, has come in late to...
-
Wilson Thomas is in the 40% federal and state income tax bracket. At a recent United Way charity auction, Wilson paid $2,000 for season tickets to a local theatre company's productions. The tickets...
-
Husker's Tuxedo's, needs to raise $259 million to finance its plan for expansion. Huskers learns that the bankers recommend an offer price (or gross price) of $40 per share and they will charge an...
-
ABC Trucking's balance sheet shows a total of noncallable $38 million long-term debt with a coupon rate of 5.60% and a yield to maturity of 8.80%. This debt currently has a market value of $55...
-
July 15 Declared a cash dividend payable to common stockholders of $176,000. Aug. 15 Date of record is August 15 for the cash dividend declared on July 15. Aug. 31 Paid the dividend declared on July...
-
On December 31, 2019, when the market rate was 12%, Drum Corp issued $2,000,000, 14%, 5-year bonds. Interest is payable semi-annually on June 30 and December 31. The bonds were issued for $2,147,214,...
-
Directions: Match the word problem in column A with its answer in column B. Write the letter of the answer in the blank provided before the item. A 1. A mass of 10 kg, which may be a A. 3.16 m...
-
Briefly discuss the implications of the financial statement presentation project for the reporting of stockholders equity.
-
Use the data set discussed in Exercise 17.2 to answer the following items. 1. Conduct a multiple regression analysis using all nine predictors. Choose method equals enter. Write out the...
-
Why shouldnt use of all of the above be included in multiple-choice response options?
-
Why are multiple short-answer items preferable to one long essay question?
-
Identify a key position that you intend to make during your presentation. Using Table 14.2 as a guide, write out how you could use the PREP (PositionReasonsExamplePosition) method to effectively...
-
Identify a topic of interest. Create a storyboard to outline the titles, content, and related story line of your PowerPoint slides.
-
Create an electronic slide presentation for your topic of interest. Ensure that it conveys your key messages effectively.
Study smarter with the SolutionInn App