/************** C++ derived classes and inheritance**************/
/***********************************************************/
/** File: employee.h
* Employee class definition.
*/
#ifndef _EMPLOYEE_H
#define _EMPLOYEE_H
#include <string>
using namespace std;
class Employee {
public:
Employee(string theName, float thePayRate);
string getName() const;
float getPayRate() const;
float pay(float hoursWorked) const;
protected:
string name;
float payRate;
};
/** Employee method definitions.
*/
Employee::Employee(string theName, float thePayRate)
{
name = theName;
payRate = thePayRate;
}
string Employee::getName() const
{
return name;
}
float Employee::getPayRate() const
{
return payRate;
}
float Employee::pay(float hoursWorked) const
{
return hoursWorked * payRate;
}
#endif /* not defined _EMPLOYEE_H */
/***********************************************************/
//File: manager.h
//Manager class definition.
#ifndef _MANAGER_H
#define _MANAGER_H
#include “employee.h”
class Manager : public Employee {
public:
Manager(string theName,
float thePayRate,
bool isSalaried);
bool getSalaried() const;
float pay(float hoursWorked) const;
protected:
bool