import java.io.*; import java.util.*; /* Jessica Miller, CSE 142 This program reads input from a file containing temperature values and reports the different between each pair of temperatures. */ public class Temperatures { public static void main(String[] args) throws FileNotFoundException { File f = new File("weather2.txt"); Scanner input = new Scanner(f); double prev = input.nextDouble(); while (input.hasNext()) { if (input.hasNextDouble()) { double next = input.nextDouble(); System.out.printf("%.1f to %.1f, change = %.1f\n", prev, next, next - prev); prev = next; } else { input.next(); } } } }