Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  • 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.image text in transcribed
public static void main(String[] args) { // TODO Auto-generated method stub //Main is only for testing your code. //We will test your assignment on a (set of) different data, 50 it is NOT sufficient to simply return these results in all cases ! * Data you can use to test your assignment * datai: 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 "+averageRainfall()+" inches."); //answers: datal: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 "lowestRainfall Month();//answers: datai:January, data2: December, data3:April System.out.println("The highest rainfall recorded for any month was "thighestRainfallAmount()+" inches");//answers: data1:12, data2:12, data3:30 System.out.println("The name of the month with the highest recorded rainfall was "thighestRainfall Month();//answers: datai: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; } 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 280 29 30 31 320 33 34 35 36 37 38 39 40 410 42 43 44 45 46@ 47 48 49 500 51 52 53 54 550 56 57 58 590 60 61 62 63 640 65 66 67 680 69 70 71 72 73 74 75 760 77 78 * 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 highestRainfall Month() { 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; } Writable Smart Insert 26:1: 1603

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

2. Why has the conflict escalated?

Answered: 1 week ago

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago