programming Assignment#8 Solution

$30.00

Category:

Description

  1. Modify the Student class presented in chapter7 as follows.
    1. Each student object should also contain the scores for four tests.
    2. Provide a constructor that sets all instance values based on parameter values.
    3. Overload the constructor such that each test score is assumed to be initially zero.
    4. Provide a method called setTestScore that accepts two parameters: the test number (1 through 4) and the score.
    5. Provide a method called getTestScore that accepts the test number and returns the appropriate score.
    6. Provide a method called average that computes and returns the average test score for this student.
    7. Modify the toString method such that the test scores and average are included in the description of the student.
  2. Write a class called Course that represents a course taken at a school. Represent each student using the modified Student class above.
    1. Use an ArrayList in the Course to store the students taken that course.
    2. The constructor of the Course class should accept only the name of the course.
    3. Provide a method called average that computes and returns the average of all students’ test score averages.
    4. Create a method roll that prints all students in the course.
  3. 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

 

  1. One submission per team and one report per team member.

 

  1. 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


error: Content is protected !!