Question: PLEASE SEPERATE CODE INTO ALL THREE FILES PERSON.H PERSON.CPP AND A4Q5.CPP 5. [30 marks] Define and implement the following classes Person class with private attributes:

 PLEASE SEPERATE CODE INTO ALL THREE FILES PERSON.H PERSON.CPP AND A4Q5.CPP5. [30 marks] Define and implement the following classes Person class withprivate attributes: name, address, telephone number, e-mail address, contains the following member

PLEASE SEPERATE CODE INTO ALL THREE FILES PERSON.H PERSON.CPP AND A4Q5.CPP

5. [30 marks] Define and implement the following classes Person class with private attributes: name, address, telephone number, e-mail address, contains the following member functions, the default constructor the constructor that constructs a Person object with the specified name, address, telephone number, and e-mail; the accessor functions to return each of attribute values the member funcion whoami ) returns the type of the object (Person) and name value Faculty class is derived from Person class, it has additional private attributes department and rank (professor, associate, assistant, or lecturer). It contains the following member functions, the default constructor; the constructor that constructs a Faculty object with the specified department and rank; the accessor functions that return department and rank values; the member funcion whoami ) that returns the type of the object (Faculty) and name value Staff class is derived from Person class, it has additional private attributes: department and job title. It contains the following member functions, the default constructor; the constructor that constructs a Staff object with the specified department and job title; the accessor functions that return department and job title values; e the member funcion whoami () that returns the type of the object (Staff) and name value Student class is derived from Person class, it has additional private attributes: major, and status (freshman, sophomore, junior, or senior). It contains the following member functions, the default constructor; the constructor that constructs a Student object with the specified major and status; o the accessor functions that return major and status values, the member funcion whoami () that returns the type of the object (Student) and name value Set the function whoami () as virtual for each class that returns the type of the class and name value. For example, the whoami ) function in the Staff class would return the string "Staff: Jim Smith". Set the function whoami as virtual for each class that returns the type of the clas and name value. For example, the whoami function in the Staff class would returrn the string "Staff: Jim Smith" Write a test main program that creates a vector of pointers to Person. Create a Person, Student, Faculty, and Staff object and add pointers to these objects to your vector. Process the vector to call the whoami functions which output the object type and name value of each object from the vector pointers. Here is a sample run: Person: David Smith Student: Jim Taylor Faculty: Alice Don Staff: Mike Philip There will be at least four files need to be submitted for this program question. 1) a header file Person.h which contains the definitions of all classes, 2) an implementation file Person.cpp which contains the implementations of all classes, 3) a client test file a4q5.cpp containing main) function, 4) a script file a4q5result containing result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!