Consider a Student class that has:
• private static int variable numStudents
• private instance variables:
o private final int id
o private final String studentName
o private double quizGrades
• Appropriate one argument constructor that throws IllegalArgumentException
• Appropriate three argument constructor that throws IllegalArgumentException
• The following instance public methods:
o public int getID( )
o public String getStudentName( )
// returns a formatted string containing id, studentName, and five quiz grades.
o public double getQuizAverage( )
o public void setQuizGrade(int numQuiz, double newGrade) throws IllegalArgumentException
o public String toString( )
o public boolean equals(Object obj) - comparison based on id only
• The following static method:
o public static void decrementNumStudents( ) throws IllegalArgumentException
Implement a well-structured Java program that uses the Student class and StudentDriver class to enable an instructor to maintain the grades of 5 quizzes for a class that has a maximum capacity of 30 students. The quiz grades are kept in a text-file [url removed, login to view] of the form
where each line of the text-file contains a unique student ID, his first name (a single word), his second name (a single word), followed by five quiz grades. The minimum quiz grade is 0.0 and the maximum is 5.0
Your StudentDriver program must have the following main menu:
1. Display all students and their quiz averages.
2. Display a student and his quiz average.
3. Modify a quiz grade for a student.
4. Delete a student.
Please enter your choice:
Your program must loop as long as option 5 has not been selected. It must display an appropriate error message if an invalid choice is entered. After executing each of the options 1 to 4, your program must pause and display the message: “Press Enter key to continue . . .” . Your program must display the main menu after pressing the Enter key. Each of the options 1 to 4 must be implemented in a separate private static method. The code for “Press Enter key to continue . . .” must also be implemented is a separate private static method. Your main method must handle IllegalArgumentException, and InputMismatchException by displaying an appropriate error message, then waiting for a key press, before returning control to the main menu.
Your program must start by calling a private static method that initializes an array of Student references by reading from the text-file QuizGrades.txt. After this initialization, each of the options 1, 2, 3, and 4 must be done using the array and not the text-file. Options 3 and 4 must not update the text-file; it is only when option 5 is selected that the text-file is updated.