import java.io.*; class People6 { // Read a number of Person records from a file, store them in an array // Filter them to give all those older than a given date static final int MAXPEOPLE=100; public static void main(String[] args) throws IOException { String filename; Person [] data; int count=0; int day,month,year; Date dDay; BufferedReader in = Text.open(System.in),inFile; for(;;) try { System.out.print("\nEnter file name to read from: "); filename=Text.readString(in); inFile=Text.open(filename); break; } catch(FileNotFoundException e) { System.out.println("No file of that name found"); } data = new Person[MAXPEOPLE]; try { for(;;) try { data[count++] = readPerson(inFile); } catch(PersonException e) { System.out.println(e.getMessage()); count--; } } catch(IOException e) { } catch(ArrayIndexOutOfBoundsException e) { System.out.print("Maximum number of people ("+MAXPEOPLE); System.out.println(") exceeded"); } count--; System.out.println("\nThe records are:\n"); for(int i=0;i