-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student.h
44 lines (37 loc) · 996 Bytes
/
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
#pragma once
#include <string>
class Student
{
public:
Student();
Student(std::string name, float gpa, float studentDebt, float studentHeight);
~Student();
std::string mStudentName;
float mStudentGPA;
float mStudentDebt;
float mStudentHeight; // In Feet
// Compare Student GPA Functor
struct CompareStudentGPA
{
bool operator() (const Student& firstStudent, const Student& secondStudent) const
{
return firstStudent.mStudentGPA < secondStudent.mStudentGPA;
}
};
// Compare Student Debt Functor
struct CompareStudentDebt
{
bool operator() (const Student* firstStudent, const Student* secondStudent) const
{
return firstStudent->mStudentDebt > secondStudent->mStudentDebt;
}
};
// Compare Student Height Functor
struct CompareStudentHeight
{
bool operator() (const Student* firstStudent, const Student* secondStudent) const
{
return firstStudent->mStudentHeight > secondStudent->mStudentHeight;
}
};
};