you will modify the Department and Student Classes in A3 to use inheritance. Specifically, a generic â€˜Personâ€™ class will be created to hold basic things about a person. The Student class, and a new class named â€˜Facultyâ€™, will be created as subclasses to Person.
Student and Faculty will inherit the above and be defined as follows: Student: inherits all Person attributes, but adds status, major, enrolled, credits, and qpoints (same as A2) Faculty: inherits all Person attributes, but adds rank, active, teach_load, specialty, funding Student and Faculty both inherit the new samePerson method that does exactly what sameStudent does, except for a generic Person object Student uses the Person constructor, but adds its own attribute definitions as defined in A2, specifically major, enrolled, credits, and qpoints. Faculty uses the Person constructor, but adds its own attribute definitions as follows
Student and Faculty both override the __str__ method as follows: Student returns the string â€˜Student: â€˜ run the parent â€œ__str__â€ + status + majorâ€™ (â€œsuper().__str__â€) Faculty returns the string â€˜Faculty: â€˜ run the parent â€œ__str__â€ + rank + specialty Department must be modified to track the roster of students and faculty and implement a separate addFaculty method. It will also use the samePerson() method instead of sameStudent(). It is permissible to define two rosters, one each for faculty and students, and an addFaculty method apart from the addStudent method. However, use your best judgment as to how to implement these. The â€˜printRosterâ€™ method can be made generic by adding a parameter, â€˜sâ€™ or â€˜fâ€™, to determine which roster to print. To create and test the Department, Person, Student, and Faculty classes do the following: 1. A lot of the previously created Department and Student code from A3 will be reused. Create Department and Student objects as you did for A3, except the Student class objects (Person subclass) have inherited characteristics of the Person class. Create the new Faculty objects as a Person subclass and create some Faculty objects . 2. Within the program, create and print enough objects of all types to test and demonstrate the class capabilities Probably 2 or 3 Department, 6 Faculty, and 10 students are adequate. 3. Add each of the created students into one of the three Department class objects using the â€˜addStudentâ€™ method 4. Likewise add each created faculty into one of the departmentâ€™s using the â€˜addFacultyâ€™ method. 5. Use the printRoster method to display a list of students in that department and faculty. The program should include code to use the above classes and methods and produce an output log to show the creation and testing activities. Enough activities should be executed and displayed to show the capabilities of the various classes. The GTA will judge the adequacy of this test code, so err on the side of testing too much.