-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDeptartment.cpp
68 lines (53 loc) · 1.48 KB
/
Deptartment.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
67
68
#include "Deptartment.h"
Deptartment::Deptartment(const string& name, const string& director, int capcity, int num) : did(did),
name(name),
director(
director),
capcity(capcity),
num(num) {}
Deptartment::Deptartment() {}
int Deptartment::getDid() const {
return did;
}
void Deptartment::setDid(int did) {
Deptartment::did = did;
}
const string& Deptartment::getName() const {
return name;
}
void Deptartment::setName(const string& name) {
Deptartment::name = name;
}
const string& Deptartment::getDirector() const {
return director;
}
void Deptartment::setDirector(const string& director) {
Deptartment::director = director;
}
int Deptartment::getCapcity() const {
return capcity;
}
void Deptartment::setCapcity(int capcity) {
Deptartment::capcity = capcity;
}
int Deptartment::getNum() const {
return num;
}
void Deptartment::setNum(int num) {
Deptartment::num = num;
}
bool Deptartment::operator==(const Deptartment& rhs) const {
return did == rhs.did &&
name == rhs.name &&
director == rhs.director &&
capcity == rhs.capcity &&
num == rhs.num;
}
bool Deptartment::operator!=(const Deptartment& rhs) const {
return !(rhs == *this);
}
ostream& operator<<(ostream& os, const Deptartment& deptartment) {
os << "did: " << deptartment.did << " name: " << deptartment.name << " director: " << deptartment.director
<< " capcity: " << deptartment.capcity << " num: " << deptartment.num;
return os;
}