-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasePlusCommissionEmployee.h
More file actions
27 lines (21 loc) · 928 Bytes
/
BasePlusCommissionEmployee.h
File metadata and controls
27 lines (21 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Fig. 12.15: BasePlusCommissionEmployee.h
// BasePlusCommissionEmployee class derived from CommissionEmployee.
#pragma once
#ifndef BASEPLUS_H
#define BASEPLUS_H
#include <string> // C++ standard string class
#include "CommissionEmployee.h" // CommissionEmployee class definition
class BasePlusCommissionEmployee : public CommissionEmployee {
public:
BasePlusCommissionEmployee(const std::string&, const std::string&,
const std::string&, double = 0.0, double = 0.0, double = 0.0);
virtual ~BasePlusCommissionEmployee() = default; // virtual destructor
void setBaseSalary(double); // set base salary
double getBaseSalary() const; // return base salary
// keyword virtual signals intent to override
virtual double earnings() const override; // calcualte earnings
virtual std::string toString() const override; // string representation
private:
double baseSalary; // base salary per week
};
#endif // !BASEPLUS_H