-
Notifications
You must be signed in to change notification settings - Fork 0
/
student.cpp
114 lines (94 loc) · 2.42 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#pragma once
#include <string>
#include <iostream>
#include "degree.h"
#include "student.h"
Student::Student(string studentId, std::string firstName, std::string lastName, std::string emailAddress, int age, int *daysToCompleteEachCourse, Degree::DegreeType type) {
this->setStudentId(studentId);
this->setFirstName(firstName);
this->setLastName(lastName);
this->setEmailAddress(emailAddress);
this->setAge(age);
this->setDaysToCompleteEachCourse(daysToCompleteEachCourse);
this->setDegreeProgram(type);
}
Student::~Student()
{
}
void Student::setStudentId(string studentId) {
this->studentId = studentId;
}
void Student::setFirstName(std::string firstName) {
this->firstName = firstName;
}
void Student::setLastName(std::string lastName) {
this->lastName = lastName;
}
void Student::setEmailAddress(std::string emailAddress) {
this->emailAddress = emailAddress;
}
void Student::setAge(int age) {
this->age = age;
}
void Student::setDegreeProgram(Degree::DegreeType type) {
this->degreeProgram = type;
switch (type)
{
case Degree::SECURITY:
this->degreeProgramString = "SECURITY";
break;
case Degree::NETWORK:
this->degreeProgramString = "NETWORK";
break;
case Degree::SOFTWARE:
this->degreeProgramString = "SOFTWARE";
break;
case Degree::NONE:
this->degreeProgramString = "NONE";
break;
default:
break;
}
}
void Student::setDaysToCompleteEachCourse(int *daysToCompleteEachCourse) {
for (int i = 0; i < 3; i++) {
this->daysToCompleteEachCourse[i] = daysToCompleteEachCourse[i];
}
}
string Student::getStudentId() {
return this->studentId;
}
string Student::getFirstName() {
return this->firstName;
}
string Student::getLastName() {
return this->lastName;
}
string Student::getEmailAddress() {
return this->emailAddress;
}
string Student::getDegreeProgramString()
{
return this->degreeProgramString;
}
int Student::getAge() {
return this->age;
}
int *Student::getDaysToCompleteEachCourse() {
return this->daysToCompleteEachCourse;
}
Degree::DegreeType Student::getDegreeProgram()
{
return Degree::NONE;
}
void Student::print()
{
int* days = getDaysToCompleteEachCourse();
cout << getStudentId() << "\t";
cout << "First Name: " << getFirstName() << "\t";
cout << "Last Name: " << getLastName() << "\t";
cout << "Age: " << getAge() << "\t";
cout << "\t Days in Courses: " << days[0] << "," << days[1] << "," << days[2] << "\t";
cout << "Degree Program: " << getDegreeProgramString();
cout << endl;
}