@@ -0,0 +1,1333 @@
+package chapter15;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Paths;%0Aimport java.util.NoSuchElementException;%0Aimport java.util.Scanner;%0A%0Apublic class ReadTextFile %7B%0A%0A%09private static Scanner input;%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09openFile();%0A%09%09readRecords();%0A%09%09closeFile();%0A%09%7D%0A%09%0A%09// open file clients.txt%0A%09public static void openFile() %7B%0A%09%09try %7B%0A%09%09%09input = new Scanner(Paths.get(%22clients.txt%22));%0A%09%09%7D catch (IOException ioException) %7B%0A%09%09%09System.err.println(%22Error opening file. Terminating.%22);%0A%09%09%09System.exit(1);%0A%09%09%7D%0A%09%7D%0A%09%0A%09// read record from file%0A%09public static void readRecords() %7B%0A%09%09System.out.printf(%22%25-10s%25-12s%25-12s%2510s%25n%22, %22Account%22, %22First Name%22, %22Last Name%22, %22Balance%22);%0A%09%09%0A%09%09try %7B%0A%09%09%09while (input.hasNext()) %7B // while there is more to read%0A%09%09%09%09// display record contents%0A%09%09%09%09System.out.printf(%22%25-10d%25-12s%25-12s%2510.2f%25n%22, input.nextInt(), input.next(), input.next(), input.nextDouble());%0A%09%09%09%7D%0A%09%09%7D catch (NoSuchElementException elementException) %7B%0A%09%09%09System.err.println(%22File improperly formed. Terminating.%22);%0A%09%09%7D catch (IllegalStateException stateException) %7B%0A%09%09%09System.err.println(%22Error reading from file. Terminating%22);%0A%09%09%7D%0A%09%7D // end method readRecords%0A%09%0A%09// close file and terminate application%0A%09public static void closeFile() %7B%0A%09%09if (input != null)%0A%09%09%09input.close();%0A%09%7D%0A%09%0A%7D // end class ReadTextFile%0A

Create ReadTextFile.java