text file in which the records are listed one after the other the five fields of the record are each stored on separate line the first line contains the id numberthe second and third contain the first and last namesthe fourth line contains the classification codeand the grade point average follows on the fifth line the following text block illustrates the format for file containing two records john smith jane roberts listing provides the implementation of the adt for extracting the records from the text file in the given format the constructor simply initializes an instance of the class by creating two attributesone to store the name the text file and the other to store reference to the file object after it' opened the open(method is responsible for opening the input file using the name saved in the constructor the resulting file object is saved in the inputfile attribute so it can be used in the other methods after the records are extractedthe file is closed by calling the close(method listing the studentfile py module implementation of the studentfilereader adt using text file as the input source in which each field is stored on separate line class studentfilereader create new student reader instance def __init__selfinputsrc )self _inputsrc inputsrc self _inputfile none open connection to the input file def openself )self _inputfile openself _inputsrc"rclose the connection to the input file def closeself )self _inputfile close(self _inputfile none extract all student records and store them in list def fetchallself )therecords list(student self fetchrecord((listing continued