All of the following exercises involve making modifications/extensions to the SRS code presented in this chapter. If you haven't already done so, please download the code from the Apress web site in preparation for these exercises; see Appendix D for details.
Expand the SRS.cs class's Main method to represent a second semester's worth of course registrations. (Hint: this will require a second instantiation of the ScheduleOfClasses class.)
Change the grades received by some Students in the first semester to failing grades, then attempt to register the Student for a course in the second semester requiring successful completion in a previous semester.
Try registering a Student for a course in the second semester that he or she has already successfully completed in the first semester.
Improve the logic of the AddPrerequisite method of the Course class to ensure that a Course can't accidentally be assigned as its own prerequisite.
Implement a CancelSection method for the Course class, and then correct the erroneous logic of the ScheduleSection method having to do with the manner in which Section numbers are assigned. (Hint: introduce a static field to the Course class for this purpose.)
The Enroll method of the Section class doesn't take into account the fact that a Student may simultaneously be registered for a course and its prerequisite. Modify this method to allow for this possibility.
The PostGrade method of the Section class makes mention of the need for an EraseGrade method, in the event that a Professor wishes to change his or her mind about the grade that has been issued to a Student; create the EraseGrade method.
Advanced exercise: Modify the ScheduleSection method of the Course class to prevent two Sections from being scheduled for the same classroom at the same day/time.
Advanced exercise: The Display method of the ScheduleOfClasses class doesn't presently list Sections in alphabetically sorted order by course name; make whatever changes are necessary to do so.