-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPAMonitor.cc
49 lines (40 loc) · 1.13 KB
/
GPAMonitor.cc
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
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
#include "GPAMonitor.h"
/*
//GPAMonitor Ctor
GPAMonitor::GPAMonitor(vector<string> gpal)
: Monitor(gpal) {
cout << "In gpamonitor ctor" << endl;
}
*/
//GPAMonitor Ctor
GPAMonitor::GPAMonitor(float gm)
: gpaMin(gm){
//cout << "In gpamonitor ctor" << endl;
}
//GPAMonitor Dtor
GPAMonitor::~GPAMonitor() {
//cout << "In gpamonitor ctor" << endl;
}
//GPAMonitor-specific update() function implementation
//Checks if the given student's GPA is belowthe minimum threshold
void GPAMonitor::update(Student* stu){
string aGPALog;
if(stu->computeGPA() <= gpaMin){
//Create a new log with id and GPA
aGPALog = "--Id : " + to_string(stu->getId()) + " --GPA : "
+ to_string(stu->computeGPA());
/*
aGPALog = "--Id : " + to_string(stu->getId()) + " --GPA : "
+ to_string((int)stu->computeGPA()) + "."
+ to_string((int)(stu->computeGPA()-(int)stu->computeGPA())*10000);
*/
//Adds the new log to its collection
inTheLog.push_back(aGPALog);
}
return;
}