import java.io.*; import java.util.*; class Students { // Read a number of Student records from a file, store them in an array static final int MAXSTUDENTS=100; static final int MAXMARKS=30; public static void main(String[] args) throws IOException { String filename; Student [] data; int count=0; 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 Student[MAXSTUDENTS]; try { for(;;) try { data[count++] = readStudent(inFile); } catch(PersonException e) { System.out.println(e.getMessage()); count--; } } catch(IOException e) { } catch(ArrayIndexOutOfBoundsException e) { System.out.print("Maximum number of students ("+MAXSTUDENTS); System.out.println(") exceeded"); } count--; new PeopleSorter(new PeopleOrderByName()).sort(data,count); System.out.println("\nThe records are:\n"); for(int i=0;i