Question
Write a C++ console program that defines and utilizes a set of classes that are related by inheritance. Design a class named Person that has
Write a C++ console program that defines and utilizes a set of classes that are related by inheritance. Design a class named Person that has 2 subclasses that are named Student and Employee. The Employee class will itself have two subclasses named Staff and Faculty. The Person class should have data members for name, address, phone number and email address. The Student class should have a data member for class status that can take on the values ["freshman", "sophomore", "junior", "senior"]. The Employee class should have data members for office#, salary, and date hired. The Faculty class should have data members for office hours and tenure status. The Staff class should have a data member for title which would hold a value such as "Vice President". Create a member function named print that is in the root class and then override it in all subclasses. It should simply print the name of the C++ class and the name of the person. From main, create instance objects of each class and then call the print method on each object.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started