This repository has been archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.h
88 lines (65 loc) · 1.42 KB
/
student.h
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
// Jonathan Ho
// Office Hour Visit
// This is the header file for my implementation of a student
#ifndef STUDENT_H
#define STUDENT_H
#include <string>
using namespace std;
class student {
public:
// default constructor with no arguments
student() {
name_ = "";
topic_ = "";
arrivalTime_ = 0;
startTime_ = 0;
length_ = 0;
urgency_ = 0;
}
// constructor with arguments
student(string n, string t, int a, int l, int u) {
name_ = n;
topic_ = t;
arrivalTime_ = a;
startTime_ = 0;
length_ = l;
urgency_ = u;
}
// getters / accessors
string name() const {
return name_;
}
string topic() const {
return topic_;
}
int arrivalTime() const {
return arrivalTime_;
}
int startTime() const {
return startTime_;
}
int length() const {
return length_;
}
int urgency() const {
return urgency_;
}
string report(bool arrLog) const;
bool isDefault() const;
// setters / mutators
void setStartTime(int t) {
startTime_ = t;
}
// comparison operators
bool operator < (const student &other) const {
return urgency_ < other.urgency(); // compares the urgency values of two students
}
private:
string name_; // student name
string topic_; // the topic of the meeting
int arrivalTime_; // time at which student arrives
int startTime_; // time at which meeting begins
int length_; // the length of the meeting
int urgency_; // the urgency of the meeting
};
#endif // STUDENT_H