-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.cpp
More file actions
72 lines (60 loc) · 2.21 KB
/
student.cpp
File metadata and controls
72 lines (60 loc) · 2.21 KB
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
#include <iostream>
#include <string>
#include "student.h";
using namespace std;
Student::Student()
{
this->studentID = "";
this->firstName = "";
this->lastName = "";
this->emailAddress = "";
this->age = 0;
for (int i = 0; i < numOfDaysToComplete; i++) this->days[i] = 0;
this->degreeProgram = DegreeProgram::SECURITY;
}
Student::Student(string studentID, string firstName, string lastName, string emailAddress, int age, int days[], DegreeProgram degreeProgram)
{
this->studentID = studentID;
this->firstName = firstName;
this->lastName = lastName;
this->emailAddress = emailAddress;
this->age = age;
for (int i = 0; i < numOfDaysToComplete; i++) this->days[i] = days[i];
this->degreeProgram = degreeProgram;
}
Student::~Student() {}
// getters
string Student::getStudentID() { return this->studentID; }
string Student::getFirstName() { return this->firstName; }
string Student::getLastName() { return this->lastName; }
string Student::getEmailAddress() { return this->emailAddress; }
int Student::getAge() { return this->age; }
int* Student::getDays() { return this->days; }
DegreeProgram Student::getDegreeProgram() { return this->degreeProgram; }
// setters
void Student::setStudentID(string studentID) { this->studentID = studentID; }
void Student::setFirstName(string firstName) { this->firstName = firstName; }
void Student::setLastName(string lastName) { this->lastName = lastName; }
void Student::setEmailAddress(string email) { this->emailAddress = emailAddress; }
void Student::setAge(int age) { this->age = age; }
void Student::setDays(int days[])
{
for (int i = 0; i < numOfDaysToComplete; i++) this->days[i] = days[i];
}
void Student::setDegreeProgram(DegreeProgram degreeProgram) { this->degreeProgram = degreeProgram; }
void Student::printHeader()
{
cout << "OutPut format: StudentID|FirstName|LastName|Email|Age|Days|Degree\n";
}
void Student::print()
{
cout << this->getStudentID() << '\t';
cout << this->getFirstName() << '\t';
cout << this->getLastName() << '\t';
cout << this->getEmailAddress() << '\t';
cout << this->getAge() << '\t';
cout << this->getDays()[0] << ',';
cout << this->getDays()[1] << ',';
cout << this->getDays()[2] << '\t';
cout << degreeProgramStrings[this->getDegreeProgram()] << '\n';
}