-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemployee.ixx
40 lines (33 loc) · 1.21 KB
/
employee.ixx
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
export module employee;
import std;
namespace Records {
const int DefaultStartingSalary{ 30'000 };
export const int DefaultRaiseAndDemeritAmount{ 1'000 };
export class Employee
{
public:
Employee(const std::string& firstName,
const std::string& lastName);
void promote(int raiseAmount = DefaultRaiseAndDemeritAmount);
void demote(int demeritAmount = DefaultRaiseAndDemeritAmount);
void hire(); // Hires or rehires the employee
void fire(); // Dismisses the employee
void display() const;// Outputs employee info to console
// Getters and setters
void setFirstName(const std::string& firstName);
const std::string& getFirstName() const;
void setLastName(const std::string& lastName);
const std::string& getLastName() const;
void setEmployeeNumber(int employeeNumber);
int getEmployeeNumber() const;
void setSalary(int newSalary);
int getSalary() const;
bool isHired() const;
private:
std::string m_firstName;
std::string m_lastName;
int m_employeeNumber{ -1 };
int m_salary{ DefaultStartingSalary };
bool m_hired{ false };
};
}