Question: Instruction :- Write all answers in a .cpp file and upload it using the upload option below this question. Be sure to number your question

Instruction:- Write all answers in a .cpp file and upload it using the upload option below this question. Be sure to number your question properly.

Use the following class definition of Employee and Manager to answer the questions that follow.

class Employee {

public:

Employee(string name, float payRate);

string getName();

float getPayRate();

float pay(float hoursWorked);

protected:

string name;

float payRate;

};

class Manager : public Employee {

public:

Manager(string theName,

float thePayRate,

bool isSalaried);

bool getSalaried() const;

float pay(float hoursWorked) const;

private:

bool salaried;

};

Employees paid by a salary (i.e., those that are salaried) get a fixed amount of money each pay period (e.g., week, 2 weeks, month) regardless of how many hours they work. If the manager is salaried, payRate is the fixed rate for the pay period; otherwise, it represents an hourly rate, just like it does for a regular employee. Note: A manager can be salaried or hourly paid.

A. Write the codes for the constructor of class Employee. (5 Points)

B. Write codes for the constructor of class Manager. (4 Points)

C. Write codes to implement the function pay in class Employee. (4 Points)

Plz Write this in C++

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!