-
Notifications
You must be signed in to change notification settings - Fork 0
/
student.cpp
98 lines (94 loc) · 2.32 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "student.h"
//Create Student Constructors
Student::Student() {
this->studentID = "";
this->firstName = "";
this->lastName = "";
for (int i = 0; i < daysInCourse; ++i) {
this->days[i] = 0;
}
this->degree = DegreeProgram::SECURITY;
}
Student::Student(string studentID, string firstName, string lastName, string email, int age, int days[daysInCourse], DegreeProgram degree) {
this->studentID = studentID;
this->firstName = firstName;
this->lastName = lastName;
this->email = email;
this->age = age;
this->degree = degree;
for (int i = 0; i < daysInCourse; ++i) {
this->days[i] = days[i];
}
}
//Create Student Destructor
Student::~Student() {}
//Create getters
string Student::getStudentID() {
return this->studentID;
}
string Student::getFirstName() {
return this->firstName;
}
string Student::getLastName() {
return this->lastName;
}
string Student::getEmail() {
return this->email;
}
int Student::getAge() {
return this->age;
}
const int* Student::getDays() {
return this->days;
}
DegreeProgram Student::getDegreeProgram() {
return this->degree;
}
//Create setters
void Student::setStudentID(string ID) {
this->studentID = ID;
}
void Student::setFirstName(string firstName) {
this->firstName = firstName;
}
void Student::setLastName(string lastName) {
this->lastName = lastName;
}
void Student::setEmail(string email) {
this->email = email;
}
void Student::setAge(int age) {
this->age = age;
}
void Student::setDays(const int days[]) {
for (int i = 0; i < daysInCourse; ++i) {
this->days[i] = days[i];
}
}
void Student::setDegreeProgram(DegreeProgram degree) {
this->degree = degree;
}
//void Student::printStudent() {
// cout << "Student ID:\t";
// cout << "First Name:\t";
// cout << "Last Name:\t";
// cout << "Email:\t";
// cout << "Age:\t";
// cout << "Course I:\t";
// cout << "Course II:\t";
// cout << "Course III:\t";
// cout << "Degree Program:\t";
// cout << endl;
//}
void Student::print() {
cout << this->studentID << '\t';
cout << this->firstName << '\t';
cout << this->lastName << '\t';
cout << this->email << '\t';
cout << this->age << '\t';
cout << this->days[0] << '\t';
cout << this->days[1] << '\t';
cout << this->days[2] << '\t';
cout << stringForDegreeProgram[(int)this->degree];
cout << endl;
}