Question: Problem add a mark variable to the class (integer between 0 and 100), accessors and mutators for the variable and modify the toString to include

Problem

add a mark variable to the class (integer between 0 and 100), accessors and mutators for the variable and modify the toString to include the mark.

Create another class called Course which will have a Student array as an instance variable (to hold the students in the course). Add a count variable to hold a count of the actual number of students enrolled in the course. The Course class should also have a default constructor (the default capacity of the array should be 10), an addStudent method, a toString, and a classAverage method which returns the class average for the course.

The driver/application program should create a COMP1130 course object, then call the addStudent method five times to add 5 students to the course. Call the course toString to print a display of the students. Finally call the classAverage method to calculate and return the class average, which will then be printed by the application program.

Include comments in your output to describe what you are testing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!