Description
Files Lab Six in Java
Microsoft Word – Lab_6.docx
Problem description
You are given a text file called ‘Students.txt’ that contains information on many students. Your program reads the file, creating many Student objects, all of which will bestoredintoanarraylistofStudentobjects,intheStudentsclass. TheTesterclass controls everything, calling many Students class methods to produce lots of different outputs. The program must write the output to an output file and to the Terminal Window.
File and class specifications
Students.txt file format
Information for each student is stored in the file as 3 lines of text:
name age GPA
e.g. the following shows data for two students:
Name0
22
1.2
Name1
22
2.71
Student class
The Student class has instance variables and methods to represent one single student.
Your Student class must have exactly and only the following instance variables:
private String name;
private int age;
private double gpa;
Microsoft Word – Lab_6.docx
Design appropriate constructors and other methods for your Student class, including: + toString() – returns a String containing the 3 instance variables e.g.
Name0 22 1.2
Students class
Very importantly, the Students class is used to store and process many Student objects. It will have an instance variable to store many Student objects. Methods intended to process many Student objects belong in this Students class.
Your Students class must have exactly and only the following instance variable: private ArrayList