XXXXXXXXXXXXX Homework 3 Purpose: The point of this assignment is to write a database for the registrar of a college. The database keeps track of courses by department name and number, and tracks students by name. Information that is kept about the courses includes: name, number, meeting times, maximum enrollment, and an alphabetized list of currently enrolled students. Information relating to the students includes: name (last, first), hair color, and a list of courses the student is taking. A caveat is that the style of any added code must match the style of the file to which it was added. Apologies to all who find it hard to read... I/O: The program reads and writes data from streams, which can be redirected from and to anywhere the user wants (script files, the printer, &c.). But the program was written primarily as an interactive database with the keyboard and monitor in mind. So the program will print a list of commands the first time it is run. From there, the user types in commands and the program displays the result of each command. Limitations: The database can only hold 20 courses and 128 students. Courses and students cannot be removed from the database once they are entered. So if a name is entered incorrectly, the mistake cannot be corrected unless the program is quit and restarted (in which case all data is lost). Bugs: None known. Algorithm: The main() function sets up the database and calls interact(). interact() is the main loop that handles input. It reads user input and compares the input to a list of commands to try to find a match. If a match is found, the proper function is called to deal with the input. If not, an error message is displayed. The methods of creating and updating data such as course meeting times are straightforward. Arrays (such as strings) are created with new and deleted later in the class destructor. Updating an array like a student name consists of deleting the old array and creating a new one with the new information. Basic variables like course numbers are just set to their new values. Adding and removing students to or from courses is slightly more complicated. When a student is enrolled in a course, the first null pointer in the student's schedule is pointed at the course. This adds the course to the student's schedule, but the pointer only points in one direction. The Student then calls the Course's function to add that student to the course's roster. The course roster is then updated to contain a pointer back to the student. Dropping courses uses essentially the same method in reverse. First the course is removed from the student's schedule, then the Student tells the Course to remove him from the roster. Data Structures: This program uses arrays and pointers to organize its data. The Registrar_DB class contains an array of Course objects and an array of Student objects. These arrays have a fixed length. The Course class contains an array of pointers to Students to keep track of all the students enrolled in the course. The array is kept alphabetized by student name. Its length is fixed upon creation of the course, but each course may have a different length. The Student class contains an array of pointers to Courses that the student is taking. This array has a fixed length of five because students are not allowed to take more than five courses. Files: assign_03.cc - The main file where the main() and interact() functions are. readstring.cc and readstring.hh - Contain the new and improved whitespace-separated, non-whitespace-string-reading function readString(), functional version 1.0, stylistic version 2.0. (Now with new spaces between operators!) registrar.cc and registrar.hh - Contain the Registrar_DB class that holds all data. course.cc and course.hh - Contain the Course class that Registrar_DB uses. student.cc and student.hh - Contain the Student class that Registrar_DB uses.