forked from ChengUU/KernoManage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudent.cpp
83 lines (69 loc) · 1.41 KB
/
Student.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "Student.h"
Student::Student(){}
Student::Student(const Student &stu) {
new (this)Student(stu.Marjor,stu.Id,stu.Name,stu.uid);
}
Student::Student(const string major, const string id, const string name)
{
new (this)Student(major,id,name,"");
}
Student::Student(const string major, const string id, const string name, const string uid)
{
this->Marjor = major;
this->Id = id;
this->Name = name;
this->uid=uid;
}
void Student::setMarjor(const string &major)
{
this->Marjor = major;
}
void Student::setId(const string &id)
{
this->Id = id;
}
void Student::setName(const string &name)
{
this->Name = name;
}
void Student::setUId(const string uid)
{
this->uid=uid;
}
string Student::getMarjor()
{
return this->Marjor;
}
string Student::getId()
{
return this->Id;
}
string Student::getName()
{
return this->Name;
}
string Student::getUId()
{
return this->uid;
}
void Student::pushRecord(Record record)
{
this->records.push_back(record);
}
list<Record> Student::getRecords()
{
return this->records;
}
void Student::setRecords(list<Record> records)
{
this->records = records;
}
string Student::toString()
{
string str;
str.append("[Id=" + this->Id);
str.append(",Name=" + this->Name);
str.append(",Major=" + this->Marjor);
str.append("]");
return str;
}