Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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();

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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

What should Belindas and Marcus next steps be?

Answered: 1 week ago