-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.cpp
More file actions
executable file
·77 lines (63 loc) · 1.18 KB
/
Copy pathPerson.cpp
File metadata and controls
executable file
·77 lines (63 loc) · 1.18 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
73
74
75
76
77
// Jaden Heller
// 2328279
// jaheller@chapman.edu
// CPSC-350-01
// Assignment 6
#include "Person.h"
//Class that defines the generic traits that both students and faculty have in common
Person::Person(){
idNum;
name;
level;
}
Person::~Person(){
}
//"Set" functions:
void Person::setID(int id){
idNum = id;
}
void Person::setName(string n){
name = n;
}
void Person::setLevel(string lev){
level = lev;
}
//"Get" functions:
int Person::getID(){
return idNum;
}
string Person::getName(){
return name;
}
string Person::getLevel(){
return level;
}
bool Person::lessThan(Person* p){
if(idNum < p->getID()){
return true;
}
else{
return false;
}
}
bool Person::greaterThan(Person* p){
if(idNum > p->getID()){
return true;
}
else{
return false;
}
}
bool Person::equalTo(Person* p){
if(idNum == p->getID()){
return true;
}
else{
return false;
}
}
void Person::printInfo(){
cout << "ID Number: " << idNum << endl;
cout << "Name: " << name << endl;
cout << "Level: " << level << endl;
}