// Allison Obourn
// CS& 141, Winter 2021
// Lecture 10

// This program reads weather data (real numbers) from a file and outputs the difference in 
// temperature for each consecutive pair of days. It ignores any non-double data in the file

import java.util.*;
import java.io.*;

public class Weather {
   public static void main(String[] args) throws FileNotFoundException {
      Scanner input = new Scanner(new File("weather2.txt"));
      double first = input.nextDouble();
      while(input.hasNext()) {
         if(input.hasNextDouble()) {
            double second = input.nextDouble();
            System.out.println(first + " to " + second + ", change = " + (second - first));
            first = second;
         } else {
            input.next();
         }
      }
   }
}