Lab 7 Student

 

Modify the Student class presented in Ch7 of the textbook as follows. Each student object should also contain the scores for three different tests. Initialize all test scores initially to zero in the existing constructor. Create a second constructor (or overload the constructor) to set all instance values based on parameter argument values. Provide a method called setTestScore that accepts two parameters: the test number (1 through 3) and the score. Also provide a method called getTestScore that accepts the test number and returns the appropriate score. Provide a method called average that computes and returns the average test score for the student. Modify the toString method such that the test scores and average are included in the description of the student. Modify the driver class main method to demonstrate the new Student methods.