-
Notifications
You must be signed in to change notification settings - Fork 0
/
worker.cpp
66 lines (55 loc) · 1.03 KB
/
worker.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "worker.h"
//员工
Employee::Employee(int ID, string name, int DeptID)
{
m_ID = ID;
m_name = name;
m_DeptID = DeptID;
}
void Employee::showInfo()
{
cout << "职工编号: " << m_ID
<< " \t职工姓名: " << m_name
<< " \t岗位:" << this->getDeptname()
<< " \t岗位职责:完成经理交给的任务" << endl;
}
string Employee::getDeptname()
{
return "员工";
}
//经理
Manager::Manager(int ID, string name, int DeptID)
{
m_ID = ID;
m_name = name;
m_DeptID = DeptID;
}
void Manager::showInfo()
{
cout << "职工编号: " << m_ID
<< " \t职工姓名: " << m_name
<< " \t岗位:" << this->getDeptname()
<< " \t岗位职责:完成老板交给的任务,并下发任务给员工" << endl;
}
string Manager::getDeptname()
{
return "经理";
}
//老板
Boss::Boss(int ID, string name, int DeptID)
{
m_ID = ID;
m_name = name;
m_DeptID = DeptID;
}
void Boss::showInfo()
{
cout << "职工编号: " << m_ID
<< " \t职工姓名: " << m_name
<< " \t岗位:" << this->getDeptname()
<< " \t岗位职责:管理公司所有事物" << endl;
}
string Boss::getDeptname()
{
return "总裁";
}