-
Notifications
You must be signed in to change notification settings - Fork 0
/
student.h
105 lines (87 loc) · 1.9 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#pragma once
#include <string>
#include <vector>
#include <fstream>
class Student
{
public:
bool compareStudentsNames(const Student &a, const Student &b);
Student(){};
Student(std::string n, std::string s, std::vector<int> m, int e, double avg, double med, std::string c = "");
~Student(){};
Student &operator=(const Student &that)
{
name = that.name;
surname = that.surname;
marks = that.marks;
exam = that.exam;
final_mark_avg = that.final_mark_avg;
final_mark_med = that.final_mark_med;
category = that.category;
return *this;
};
Student(const Student &that)
{
name = that.name;
surname = that.surname;
marks = that.marks;
exam = that.exam;
final_mark_avg = that.final_mark_avg;
final_mark_med = that.final_mark_med;
category = that.category;
}
// Getters
const double &getFinalMarkAvg()
{
return final_mark_avg;
};
const double getFinalMarkMed()
{
return final_mark_med;
};
const std::vector<int> &getMarks()
{
return marks;
}
const std::string &getName()
{
return name;
};
const std::string &getSurname()
{
return surname;
}
const std::string &getCategory()
{
return category;
};
// Setters
void setCategory(const std::string &c)
{
category = c;
};
void setMarks(const std::vector<int> &m)
{
marks = m;
};
void setName(const std::string &n)
{
name = n;
};
void setSurname(const std::string &s)
{
surname = s;
};
void setExam(const int &e)
{
exam = e;
}
private:
std::string name;
std::string surname;
std::vector<int> marks;
int exam;
double final_mark_avg;
double final_mark_med;
std::string category;
};