Question
Part 1. Modify the Address class (Address.java) presented in this chapter by editing the comments to Javadoc. Part 2. Modify the Student class (Student.java) presented
Part 1. Modify the Address class (Address.java) presented in this chapter by editing the comments to Javadoc. Part 2. Modify the Student class (Student.java) presented in this chapter by editing the comments to Javadoc and also as follows. Each student object should also contain the scores for three 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 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 this 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 exercise the newStudent methods. Part 3. Add a class called Course that represents a course taken at a school. Represent each student using the modified Student class above. Use an ArrayList (not array) in the Course to store the students taking that course. The constructor of the Course class should accept only the name of the course. Provide a method called addStudent that accepts one Student parameter. Provide a method called average that computes and returns the average of all students test score averages. Provide a method called roll that prints all students in the course. Edit the driver class' main method to create a course, adds several students, prints a roll, and prints the overall course test average.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started