-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathStudent.h
79 lines (55 loc) · 1.8 KB
/
Student.h
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
#ifndef STUSYSTEMGUI_STUDENT_H
#define STUSYSTEMGUI_STUDENT_H
#include <iostream>
#include<string>
// ‰≥ˆ¡˜£¨”√”⁄÷ÿ‘ÿ<<‘ÀÀ„∑˚
#include <ostream>
#include<sstream>
using namespace std;
//—ß…˙¿‡
class Student {
private:
//—ß∫≈
int id;
//—ß…˙–’√˚
string sname;
//—ß…˙ƒÍ¡‰
int age;
//—ß…˙–‘±
string sex;
//—ß…˙ºÆπ·
string native;
//—ß…˙µƒœµ±
string dept;
public:
//Œfi≤Œππ‘Ï∫Ø ˝
Student();
//”–≤Œππ‘Ï£¨≤ª–Ë“™id£¨ ˝æ›ø‚÷–…Ë÷√Œ™◊‘‘ˆ¡À
Student(const string& sname, int age, const string& sex, const string& native, const string& dept);
//
int getId() const;
void setId(int id);
const string& getSname() const;
void setSname(const string& sname);
int getAge() const;
void setAge(int age);
const string& getSex() const;
void setSex(const string& sex);
const string& getNative() const;
void setNative(const string& native);
const string& getDept() const;
void setDept(const string& dept);
//÷ÿ‘ÿ==‘ÀÀ„∑˚£¨”√”⁄≈–∂œ¡Ω∏ˆ—ß…˙∂‘œÛ «∑Òœ‡µ»
bool operator==(const Student& rhs) const;
//÷ÿ‘ÿ!=‘ÀÀ„∏Æ
bool operator!=(const Student& rhs) const;
//Œˆππ∫Ø ˝£¨œ˙ªŸ∂‘œÛ
virtual ~Student();
//÷ÿ‘ÿ ‰≥ˆ<<‘ÀÀ„∏Æ£¨±„”⁄÷±Ω”≤Èø¥—ß…˙∂‘œÛ
friend ostream& operator<<(ostream& os, const Student& student);
//get the student string
string toString();
//change a string to a Student object
static Student StringToStu(string str);
};
#endif //STUSYSTEMGUI_STUDENT_H