Question: C + + pls; Implement a class hierarchy for employees in a company. Create: a base class Employee with the following private member variables: name:

C++ pls;
Implement a class hierarchy for employees in a company. Create:
a base class Employee with
the following private member variables:
name: a string;employeeID: an int;salary: a double;
public getters and setters for all the member variables;
a derived class Manager with:
an additional private member variable department of type string;a public getter and setter for the department;a public constructor Manager(string name, int employeeID, double salary, string department);a public displayDetails() function member that returns a string representing the object in the following format:
Manager Name: [name] Employee ID: [employeeID] Salary: $ [salary] Department: [department]
a derived class Staff with:
an additional private member variable position of type string;a public getter and setter for the position;a public constructor Staff(string name, int employeeID, double salary, string position);a public displayDetails() function member that returns a string representing the object in the following format:
Staff Name: [name] Employee ID: [employeeID] Salary: $ [salary] Position: [position]
Note: when displaying the value of salary in the displayDetails function, use only one digit after the decimal point.

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 Programming Questions!