//NAME: Stella K. //DATE: Nov 15, 2007 //PURPOSE: Lab on objects, and file i/o, cs111 //WHAT: Reads student data from a file into an array. //Filters and processes that data, and writes the results //back to memory (an output file) //MODIFICATION HISTORY: import java.io.*; public class WellesleyStudents { //Reads the data from file "data.txt" into an array. //prints out the list of students in a certain section or lab //writes the results to a file //instance vars Student[] students; int numRecords = 32; //constructor //creates an array and populates it with Student objects, //which are read from the input file public WellesleyStudents(String fileIn) throws IOException { students = new Student[numRecords]; //create the array students = fromFileToArray(fileIn); //populate the array //printArray(students); //for testing purposes only } public Student[] getyearGroup(String year){ //set up an array to hold the results Student[] res = new Student[numRecords]; //some of the locations of this array will //possibly be left empty at the end of this method int j = 0; //index into the res array for (int i=0; i