Question: How to implement an add function by using a linked list. Implement Schedule::add based on the following rules. If the Schedule is empty, add the
How to implement an add function by using a linked list.
Implement Schedule::add based on the following rules.
If the Schedule is empty, add the course, update the total credit hours, and return true.
If the Schedule is not empty, examine the linked list.
If a matching course is found, return false. Students can not enroll in courses with the same course number.
If no matching course is found, check the credit hours of the new course and existing total. If the this new course along with the existing courses would exceed 12 hours, return false and do not add the course.
If the total credit hours will not exceed 12, and the course number is unique, add the new course and return true.
Implement Schedule::display. This must generate the Inventory summary. If using the sample data listed above:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
