Question: hi my code will not run. I'm confused on why can you help me fix it? here was the task list. Task 1: The system
hi my code will not run. I'm confused on why can you help me fix it?
here was the task list.
- 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.

package assignment: import java.util.Scanner public class RainfallTracker public class main ! public static int I) data new int(12): public static String() months = new String). January","February", "March","April", "May","June","July", "August", September", "October", "Nuvetber", "December"); public static void collares { adaraintal Loatal), System.out.println("The average rainfall for the year was "+averageRainfall()+" inches."); //answersi datal:8.5, data2:6.5, data3:11.91666.... System.out.println("The lowest rainfall recorded for any nonth was "lowestRainfallAmount( inches");//answersi datal:1, data2:1, data3:8 System.out.println("The name of the unth with the lowest recorded rainfall was "+lowest Rainfat Month}); //answers: datai: January System.out.printlnt"The highest rainfall recorded for any month was "thighest Rainfall Aount()+" inches");//answers: datai:12, data 2:12, data3:30 dat 2:December, datu 3: April Systen.out.println("The name of the month with the highest recorded rainfall was "thighest RaintaiMonth();//answers: data1: December, data: January, data3: June } public static double averageRainfall! { double sun = for(int i=8; icdata. length; i++) {sutudatalil; } return (sut/data.length); } public static int lowest RainfallArount() { int nin_rain = data) for(int i=1; isdata.length; i++) { if(data[i]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
