/* Scenario program for the TemperatureList class course: 15-100 Intro to Java Programming author: Mr Solution section: date: */ import java.io.*; public class Scenario { public static void main(String args[]) throws Exception { ConsoleInput io = new ConsoleInput(); FileInput fio = new FileInput("Enter the name of the temperature file: "); TemperatureList list = new TemperatureList(); list.initialize(fio); System.out.println("There were " + list.size() + " days processed"); System.out.println("There were " + list.daysAbove(list.average()) + " days above the average of "+ list.average()+" degrees"); System.out.println("There were " + list.daysBelow(list.average()) + " days below the average of "+ list.average()+" degrees"); int low=0, diff=Math.abs(list.temperatureOnDay(1)-list.temperatureOnDay(0)); for (int i=2;idiff) { low = i-1; diff=Math.abs(list.temperatureOnDay(i)-list.temperatureOnDay(i-1));} System.out.println("Days "+ low + " and " + (low+1) + " showed the greatest change in temperature"); System.out.println("The difference was "+ diff); System.out.println("The temperature on day " + low + " was "+ list.temperatureOnDay(low)); System.out.println("The temperature on day " + (low+1)+ " was "+ list.temperatureOnDay(low+1)); System.out.println("Day "+ list.lowest()+ " is the day with the lowest temperature of " + list.temperatureOnDay(list.lowest())); fio.close(); } }