Question: 1. Inheritance Abstract Classes and Polymorphism For this lab you will be using the inheritance hierarchy that you created in Lab 8A. Make the following
1. Inheritance Abstract Classes and Polymorphism
For this lab you will be using the inheritance hierarchy that you created in Lab 8A. Make the following modifications:
Add a String property to the Person class called id. Its visibility will be private.
Add abstract method to class Person called setPersonID. What does this mean for class Person? Also add the getter and setter methods for the id.
setPersonID will be public and will be implemented differently in each subclass, therefore each subclass will override the setPersonID method. Class Employee will not override setPersonID and therefore must also be declared as an abstract class.
The id for a faculty member will be the faculty members rank with the email address appended to it (e.g.Lecturerfl001@faculty.camdencc.edu).
The id for staff member will be the staff members title with the email address appended to it (e.g.Directorfl002@camdencc.edu).
The id for a student will be the email address with the students class status appended to it (e.g. Freshmanfl001@students.camdencc.edu).
Modify your test class from Lab8A. You will no longer be able to create a Person or an employee. Why?
Add your Student, Faculty Member, and Staff Member objects to an array of Person objects.
Iterate through that array setting the ids for each.
Iterate through the array displaying all the properties for each.
Notes: add rank details to faculty: 1-Lecturer, 2-Assistant Professor, 3-Associate Professor and 4-Professor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
