-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student.cpp
119 lines (96 loc) · 2.17 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
115
116
117
118
119
#include "Person.h"
#include "Student.h"
#include <string>
#include <iostream>
Student::Student() {
IDnum = 0;
name = "unknown";
level = "unknown";
major = "unknown";
GPA = 0.0;
facID = 0;
}
Student::Student(unsigned int aIDnum, string aname, string alevel, string amajor, double aGPA, unsigned int afacID) {
IDnum = aIDnum;
name = aname;
level = alevel;
major = amajor;
GPA = aGPA;
facID = afacID;
}
Student::~Student() {
}
int Student::getstudentID()
{
return IDnum;
}
string Student::getMajor() {
return major;
}
double Student::getGPA() {
return GPA;
}
int Student::getAdvisorID() {
return facID;
}
/*
void Student::setStudentID(unsigned int sID)
{
IDnum = sID;
}*/
void Student::setID (unsigned int ID)
{
IDnum = ID;
}
void Student::setMajor(string amajor) {
major = amajor;
}
void Student::setGPA(double aGPA) {
GPA = aGPA;
}
void Student::setAdvisorID(unsigned int afacID) {
facID = afacID;
}
void Student::printinfo()
{
cout << endl << "Id: " << IDnum << endl <<
"Name: " << name << endl <<
"Level: " << level << endl <<
"Major: " << getMajor() << endl <<
"GPA: " << getGPA() << endl <<
"Advisor Id: " << getAdvisorID() << endl;
}
void Student::printexit()
{
cout << IDnum << "\r\n" << name << "\r\n" << level << "\r\n" <<
getMajor() << "\r\n" << getGPA() << "\r\n" << getAdvisorID() << "\r\n";
}
/*
void Student::printexitfirst()
{
cout << IDnum << "\r\n" << name << "\r\n" << level << "\r\n" <<
getMajor() << "\r\n" << getGPA() << "\r\n" << getAdvisorID();
}*/
bool operator== (const Student &s1, const Student &s2) {
return (s1.IDnum == s2.IDnum);
}
bool operator!= (const Student &s1, const Student &s2) {
return (s1.IDnum != s2.IDnum);
}
bool operator> (const Student &s1, const Student &s2) {
return (s1.IDnum > s2.IDnum);
}
bool operator< (const Student &s1, const Student &s2) {
return (s1.IDnum < s2.IDnum);
}
// bool Student::equals(Object o) {
//
// }
/*
void Student::printStudent() {
printPerson();
std::cout << "\nMajor: " << getMajor()
<< "\nGPA: " << getGPA()
<< "\nAdvisor ID: " << getAdvisorID() << std::endl;
}
*/