Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

3. Is it a topic that your audience will find worthwhile?

Answered: 1 week ago

Question

2. Does the topic meet the criteria specified in the assignment?

Answered: 1 week ago