please solve using java eclipse. no stackoverflow
please make sure that method showZeromonths included!!
please aim to make the code function for last part of the runs that show 3 months with no precipitation
You are to write an application ProcessPrecipitation that gets monthly precipitation data for three places (e.g. Ames, LA, New Orleans, LA, Death Valley, CA, etc.) from keyboard input and then further processes the data. It finds and displays (a) the total precipitation for the year, (b) the average monthly precipitation, (c) the month with the most precipitation and the amount of precipitation for the month, and (d) the month with the least precipitation and the amount of precipitation for that month. If the place was sufficiently dry that there was no precipitation for at least one month, the months for which there was zero precipitation are displayed. The overall structure: Runs for the three places are given on the pages following this description, where the pseudocode for main could be described as follows: get value of placeName assign values to elements of precipitation using the array precipitation get value for total get value for average using the array precipitation get value of highest // an accos value to an dement of precipitation using the array precipitation get value of lowest // also an access value to an element of precipitation show information using values of place.Name, precipitation, total, average. Highest, lowest What the variables are and their meaning: - the variable placeName is a String value representing the place where the data has been taken (all data given in the sample runs was gotten off the Internet for the year 2011) - precipitation is an array of double containing 12 elements, one for each month - total is the total precipitation found for the year - average is the average precipitation found for the year (readily gotten from total) - highest is the index value of the element of precipitation containing the highest value - lowest is the index value of the element of precipitation containing the lowest value main's pseudocode is shorthand for method calls: With the exception of getting a value for average (a simple assignment statement), all of the above in the description for main represent calls to methods. Thus, for example, the code to get value of placeName would look like a call to a method coded as placeName = getNameOfPlace( ); where the return result would be of type String. In like manner, assign values to elements of precipitation codes to a call to a method that looks like precipitation = getPrecipitationValues( ); where the return result would be a reference to an array of type double. You've seen examples of this technique of getting values from the keyboard that ultimately become elements returned to an array reference with the code of the method getValuesFromKeyboard in the application TestArray and of the method getScores in the application AssignGrades. The coding of the other methods is straightforward as well, where you have seen recyclable examples similar to the logic you need in the applications I've given for the Chapter 7 material and in the Idiomatic Programming text. Hint about the month names: It would be useful to declare an additional array of 12 String values (MONTH_NAMES) that is static final (i.e. a constant that is declared before main) where the clements are three-character names of the months, i.c. Jan, Feb, Mar, Apr, May, Jun, Jul, Aug. Sep. Oct. Nov, Dec. You can very conveniently use this array as a global reference (no need to use as a parameter) to access the particular month you need to carry out a display. (Note: I talk about arrays of constants in Idiomatic Programming, pp 214-221.) There are at least 3 places (perhaps more) where this array will help you write the code for the application: - as a reference to give you the prompts for the different month names in the getPrecipitation Values method - as a reference for the name of the months with the highest and lowest precipitations - as a reference for those months that have precipitations of 0 (see below) Showing the information You may get the sense that all variables listed in the pseudocode for showing the information are arguments passed into a method whose sole purpose is to display values. You are correct with this supposition. Dealing with months having zero precipitation If a place has zero precipitation for a month, then that is clearly the lowest precipitation. However, there is no guarantee that this month was the only month with zero rainfall. Hence, you need to handle a special case if a given place has at least one month of zero precipitation. You do it by calling another method, showZeroMonths, from within the method showlnformation. This method simply uses the (static final) array to display the corresponding names of those months for which the given element in the array precipitation is 0 . Sample runs Sample runs of the application are shown on the next three pages. You're expected to use the same sample data that we used and to come up with the same sort of display that we got for the sample data. To make data entry a bit less noisome, I've provided the data entry text in the Data for Project 2 .txt file. You can simply copy each line of entry and paste it into the proper place when your application is running. (To use or ignore; you can simply do the keyboarding operation if you wish.) Sufficient suggestions have been given for you to complete the project by the final. As always, documentation and well-laid out code is important. Also, it is suggested that you break down the application into methods, most of which are based on coding of methods you have already seen in the examples and in the Idiomatic Programming text. Enter the name of the place whose precipitation statistics you want: Ames. IA Enter precipitation for Jan: 0.10 Enter precipitation for Feb: 1.08 Enter precipitation for Mar: 0.79 Enter precipitation for Apr: 8.72 Enter precipitation for May: 5.10 Enter precipitation for Jun: 11.27 Enter precipitation for Jul: 2.98 Enter precipitation for Aug: 8.14 Enter precipitation for Sep: 3.47 Enter precipitation for Oct: 4.21 Enter precipitation for Nov: 0.88 Enter precipitation for Dec: 1.53 Here are the precipitation statistics for Ames, IA: Total precipitation: 48.27 inches Average precipitation: 4.02 inches A maximum precipitation of 11.27 inches occurred during the month of Jun. A minimum precipitation of 0.10 inches occurred during the month of Jan. Enter the name of the place whose precipitation statistics you want: New Orleans, LA Enter precipitation for Jan: 2.76 Enter precipitation for Feb: 5.44 Enter precipitation for Mar: Enter precipitation for Apr: 2.31 Enter precipitation for May: 8.35 Enter precipitation for Jun: 8.03 Enter precipitation for Jul: 4.49 Enter precipitation for Aug: 5.50 Enter precipitation for Sep: 4.92 Enter precipitation for Oct: 1.64 Enter precipitation for Nov: 1.47 Enter precipitation for Dec: 4.00 Here are the precipitation statistics for New Orleans, LA: Total precipitation: 54.16 inches Average precipitation: 4.51 inches A maximum precipitation of 8.35 inches occurred during the month of May. A minimum precipitation of 1.47 inches occurred during the month of Nov. Enter the name of the place whose precipitation statistics you want: Death Valley, CA Enter precipitation for Jan: 0.00 Enter precipitation for Feb: 0.360.26 Enter precipitation for Mar: 0.36 Enter precipitation for Apr: 0.11 Enter precipitation for May: 0.02 Enter precipitation for Jun: 0.00 Enter precipitation for Jul: 0.05 Enter precipitation for Aug: 0.15 Enter precipitation for Sep: 0.76 Enter precipitation for Oct:0.00 Enter precipitation for Nov: 0.02 Enter precipitation for Dec: 0.59 Here are the precipitation statistics for Death Valley, CA: Total precipitation: 2.32 inches Average precipitation: 0.19 inches A maximum precipitation of 0.76 inches fell during the month of Sep. These months had no precipitation the whole month: Jan Jun Oct