import java.util.Scanner; import java.text.*; public class AverageRainfall { public static void main(String[] args) { int years; // Variable to hold the amount of years final int MONTHS = 12; // Constant to hold the amount of months in a year int totalMonths = 0; // Months accumulator variable double monthlyRain; // Holds the amount of rain in inches for each month double totalRainfall = 0; // Holds the total rainfall NumberFormat df = DecimalFormat.getInstance(); // Decimal formating df.setMaximumFractionDigits(2); // Create Scanner object Scanner input = new Scanner(System.in); // Prompt user for the number of years System.out.println(\"Enter the number of years: \"); years = input.nextInt(); System.out.println(\"Enter the rainfall amount for each month \"); // Construct for-loop for each year for(int i=0; i < years; i++){ for(int j=1; j Solution import java.util.Scanner; import java.text.*; public class AverageRainfall { public static void main(String[] args) { int years; // Variable to hold the amount of years final int MONTHS = 12; // Constant to hold the amount of months in a year int totalMonths = 0; // Months accumulator variable double monthlyRain; // Holds the amount of rain in inches for each month double totalRainfall = 0; // Holds the total rainfall NumberFormat df = DecimalFormat.getInstance(); // Decimal formating df.setMaximumFractionDigits(2); // Create Scanner object Scanner input = new Scanner(System.in); // Prompt user for the number of years System.out.println(\"Enter the number of years: \"); years = input.nextInt(); System.out.println(\"Enter the rainfall amount for each month \"); // Construct for-loop for each year for(int i=0; i < years; i++){ for(int j=1; j.