$29
Modify the Student class presented in chapter7 as follows.
Each student object should also contain the scores for four tests.
Provide a constructor that sets all instance values based on parameter values.
Overload the constructor such that each test score is assumed to be initially zero.
Provide a method called setTestScore that accepts two parameters: the test number (1 through 4) and the score.
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 this student.
Modify the toString method such that the test scores and average are included in the description of the student.
Write a class called Course that represents a course taken at a school. Represent each student using the modified Student class above.
Use an ArrayList in the Course to store the students taken that course.
The constructor of the Course class should accept only the name of the course.
Provide a method called average that computes and returns the average of all students’ test score averages.
Create a method roll that prints all students in the course.
Create a driver class with a main method that creates a course, adds several students, prints a roll, and prints the overall course test average.
Note:
This program should have the following classes:
MyCourseList8 (driver)
Address
Student
Course
One submission per team and one report per team member.
Zip all files of the project and attach via BlazeView. Individual report can be attached individually.
Sample output
----------------------------------------
John Smith
----------------------------------------
Home Address:
21 Jump Street Blacksburg VA 24551
School Address:
800 Lancaster Ave. Villanova PA 19085
Test 1 score: 0
Test 2 score: 0
Test 3 score: 0
Test 4 score: 0
Average test score: 0.0
----------------------------------------
Marsha Jones
----------------------------------------
Home Address:
123 Main Street Euclid OH 44132
School Address:
800 Lancaster Ave. Villanova PA 19085
Test 1 score: 100
Test 2 score: 80
Test 3 score: 94
Test 4 score: 88
Average test score: 90.5
John's score on test 1: 78
Marsha's score on test 2: 83
----------------------------------------
John Smith
----------------------------------------
Home Address:
21 Jump Street Blacksburg VA 24551
School Address:
800 Lancaster Ave. Villanova PA 19085
Test 1 score: 78
Test 2 score: 92
Test 3 score: 80
Test 4 score: 77
Average test score: 81.75
----------------------------------------
Marsha Jones
----------------------------------------
Home Address:
123 Main Street Euclid OH 44132
School Address:
800 Lancaster Ave. Villanova PA 19085
Test 1 score: 100
Test 2 score: 83
Test 3 score: 94
Test 4 score: 88
Average test score: 91.25