(Optional) Enhance your program to gain experience with backlink maintenance and reference counting as follows: 1. Implement...
Question:
(Optional) Enhance your program to gain experience with backlink maintenance and reference counting as follows:
1. Implement a DropCourse () interface for student. That is, create a Student: : DropCourse (Course *) method in Student. Here, find the course the student wishes to drop in their course list, but before removing the Course, call a method on that course to remove the aforementioned student (that is, this) from the Course.
2. Now, fully implement proper destructors. When a course is destructed, have the course destructor first tell each remaining associated student to remove their link to that course.
Likewise, when a student is destructed, loop through the Student's course list to ask those courses to remove the aforementioned student (that is, this) from their student list. You may find reference counting in each class (that is, by checking numStudents or numCourses) helpful to see whether these tasks must be engaged.
Step by Step Answer: