Question: The CourseList class should include: A class constant, specifies the maximum number of courses a student can take, set to 1 0 0 . Two
The CourseList class should include:
A class constant, specifies the maximum number of courses a student can take, set to
Two instance variables: an array storing Course objects, and an integer indicating the current number of courses in the list.
A constructor without parameters that initializes the instance variables. Upon creation, the CourseList should be empty.
A method named containsCourse that checks if the course is already in the list and returns true if it is false otherwise.
An addCourseCourse method, which adds the given Course to the list. This method has a void return type.
The getAlITitles method retrieves the titles of all courses in the list by invoking the getTitles method for each Course. It then constructs a string representation containing all the courses, with each course presented on a separate line.
ASSIGNMENT : Introduction to ObjectOriented Programming Registration
COMP Winter
The toString method generates a string that comprises the complete representation of all courses in the list, including their titles, class lists, and waitlists. Each course is presented on a separate line within the string.
Modifications to the Student class include:
Addition of a new instance variable: a CourseList, which holds the list of all courses the student is fully registered for not on the waitlist
Modification of the constructor to initialize the above instance variable with an empty CourseList.
Implementation of an addCourseCourse method, which adds the given Course to the CourseList. It's assumed that the CourseList will never reach its maximum capacity.
Implementation of a getCourseListString method, which returns a string containing the phrase "Student student description is registered to: followed by a list of course titles on subsequent lines. This list is generated using the getAllTitles method of the CourseList class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
