// CSE 142, Spring 2009 // This program prompts the user to enter several days' worth of temperatures // and computes the average temperature and how many days were above average. // import java.util.*; // for Scanner public class Weather { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("How many days' temperatures? "); int days = console.nextInt(); int[] temperatures = new int[days]; int sum = 0; int aboveAverage = 0; // read each day's temperature // 45 44 39 48 37 46 53 for (int i=0; iaverage) { aboveAverage++; } } // report results System.out.printf(aboveAverage + " days were above average"); } }