import java.util.Scanner;
public class ExerciseMonitor_yourLastName {
public static void main(String[] args) {
// to store rainfall for 12 months
double rainfall[] = new double[12];
String months[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
Scanner in = new Scanner(System.in);
for(int i=0; i<12; i++) {
System.out.printf("Enter rainfall for %s: ", months[i]);
rainfall[i] = in.nextDouble();
}
double totalRainFall = 0;
int maxRainFallMonth = 0;
int minRainFallMonth = 0;
for(int i=0; i<12; i++) {
totalRainFall += rainfall[i];
if(rainfall[i] > rainfall[maxRainFallMonth]) {
maxRainFallMonth = i;
}
if(rainfall[i] < rainfall[minRainFallMonth]) {
minRainFallMonth = i;
}
}
System.out.printf("Rainfall in the year: %.2f\n", totalRainFall);
System.out.printf("Average Monthly rainfall: %.2f\n", totalRainFall/12);
System.out.printf("The month with the most rain : %s\n", months[maxRainFallMonth]);
System.out.printf("The month with the least rain : %s\n", months[minRainFallMonth]);
in.close();
}
}
Java 4. Write the code of data type class ExerciseMonitor_yourLastName including data members with an double...
In Java language: Write a rainfall class that stores the total rainfall for each of 12 months of years 2015 -2017 into an 2D array of doubles. Use the text file at Actividades/Tareas link as input of rainfall data. The program should read the input data from a text file. The program should have methods that at least return the following: • Total rainfall for the years 2015 – 2017 - return a 1D array • The average monthly rainfall...
Consider the following data: Monthly Profit of a Gym Month Jan-12 Feb-12 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Profit ($) 5,550 5,303 4,944 4,597 5,140 5,518 6,219 6,143 5,880 Step 2 of 5 : What are the MAD, MSE and MAPE scores for the three-period moving average? Round any intermediate calculations, if necessary, to no less than six decimal places, and round your final answer to one decimal place.
Consider the following data: Monthly Profit of a Gym Month Jan-12 Feb-12 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Profit ($) 5,350 5,103 4,824 4,437 5,080 5,358 5,819 6,091 5,837 Step 4 of 5: What are the MAD, MSE and MAPE scores for the three-period weighted moving average forecast? Round any intermediate calculations, if necessary, to no less than six decimal places, and round your final answer to one decimal place.
Consider the following data: Monthly Profit of a Gym Month Jan-12 Feb-12 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Profit ($) 5,350 5,103 4,824 4,437 5,080 5,358 5,819 6,091 5,837 Step 2 of 5 : What are the MAD, MSE and MAPE scores for the three-period moving average? Round any intermediate calculations, if necessary, to no less than six decimal places, and round your final answer to one decimal place.
Consider the following data: Monthly Profit of a Gym Month Jan-12 Feb-12 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Profit ($) 5,500 5,253 4,914 4,557 5,125 5,478 6,119 6,130 5,870 Step 2 of 5 : What are the MAD, MSE and MAPE scores for the three-period moving average? Round any intermediate calculations, if necessary, to no less than six decimal places, and round your final answer to one decimal place.
Consider the following data: Monthly Profit of a Gym Month Jan-12 Feb-12 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Profit ($) 5,350 5,103 4,824 4,437 5,080 5,358 5,819 6,091 5,837 Step 3 of 5: Determine the three-period weighted moving average for the next time period with weights of 3 (most recent), 2 (second recent), and 1 (oldest time period). If necessary, round your answer to one decimal pl