Write CityLog in two steps:
static int save(Scanner in) throws FileNotFoundExceptionreadscity celsiuspairs from the keyboard until the end of input and writes them with aPrintWritertoreadings.txt(do not forgetclose()); it returns how many it wrote.static void report() throws FileNotFoundExceptionopens the file withnew Scanner(new File("readings.txt"))and prints each line as%-10s %6.1f C %6.1f F, thenAverage 19.5 C, hottest Wuhan, coldest Harbin.
main prints Saved 4 readings to readings.txt, calls report(), catches FileNotFoundException, and deletes the file in a finally block.