Code /* UseCourse3.java CIS 260 David Klick 2012-01-23 This program reads the data files created by UseCourse.java and UseCourse2.java. It displays that information on the screen. Since it just reads a line of data, splits it by delimiter, and then displays those fields, there is no need for referencing the Course class in this program. */ import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class UseCourse3 { public static void main(String[] args) { try { Scanner in = new Scanner(new File("courses.txt")); int recnum = 0; while (in.hasNextLine()) { String[] fields = in.nextLine().split("[|]", 5); System.out.print("Record #" + ++recnum + ": "); for (String s : fields) System.out.print(s + " "); System.out.println(); } in.close(); } catch (FileNotFoundException e) { System.err.println("Input file not found."); System.exit(1); } } }