#ifndef EMPLOYEE_H #define EMPLOYEE_H #include namespace emp { class Employee { private: std::string name; std::string id; std::string phone; public: Employee(std::string n, std::string i, std::string p) : name(n), id(i), phone(p) {} Employee() {} std::string getName() const { return name; } std::string getId() const { return id; } std::string getPhone() const { return phone; } void setName(std::string n) { name = n; } void setId(std::string i) { id = i; } void setPhone (std::string p ) { phone = p; } virtual ~Employee() {} virtual double pay() = 0; }; class HourlyEmployee : public Employee { private: double rate; double hrs; public: HourlyEmployee(std::string n, std::string i, std::string p, double r, double h) : Employee(n,i,p), rate(r), hrs(h) {} HourlyEmployee () {} double getRate() const { return rate; } double getHours() const { return hrs; } virtual double pay() { return rate * hrs; } }; class SalariedEmployee : public Employee { private: double salary; public: SalariedEmployee(std::string n, std::string i, std::string p, double s) : Employee(n,i,p), salary(s) {} SalariedEmployee () {} double getSalary() const { return salary; } virtual double pay() { return salary; } }; class Manager : public SalariedEmployee { private: double bonus; public: Manager(std::string n, std::string i, std::string p, double s, double b) : SalariedEmployee(n,i,p,s), bonus(b) {} Manager () {} double getBonus() const { return bonus; } virtual double pay() { return getSalary() + bonus; } }; } #endif