-
Notifications
You must be signed in to change notification settings - Fork 0
/
professor.cpp
64 lines (56 loc) · 2.21 KB
/
professor.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
#include "professor.h"
// Course Professor::allCourse[MAX_COURSES];
Course Professor::UGCDCallCourse[MAX_UGCDC_CCOURSES];
Course Professor::UGELECTallCourse[MAX_UGELECT_CCOURSES];
Course Professor::HDCDCallCourse[MAX_HDCDC_CCOURSES];
Course Professor::HDELECTallCourse[MAX_HDELECT_CCOURSES];
Professor::Professor(string nameStr, vector<int> selectUGCDC, vector<int> selectUGELECT, vector<int> selectHDCDC, vector<int> selectHDELECT, double credits)
{
name = nameStr;
creditsAvailable = credits;
popular = 0;
UGCDC = selectUGCDC;
UGELECT = selectUGELECT;
HDCDC = selectHDCDC;
HDELECT = selectHDELECT;
for (int i = 0; i < UGCDC.size(); i++)
{
UGCDCallCourse[UGCDC[i]].popular += (Course::totalUGCDCCourses - i);
}
for (int i = 0; i < UGELECT.size(); i++)
{
UGELECTallCourse[UGELECT[i]].popular += (Course::totalUGElectCourses - i);
}
for (int i = 0; i < HDCDC.size(); i++)
{
HDCDCallCourse[HDCDC[i]].popular += (Course::totalHDCDCCourses - i);
}
for (int i = 0; i < HDELECT.size(); i++)
{
HDELECTallCourse[HDELECT[i]].popular += (Course::totalHDElectCourses - i);
}
}
void Professor::getDetails()
{
cout << name << endl;
cout << "\tFirst Degree CDC's" << endl;
for (int i = 0; i < UGCDC.size(); i++)
{
cout << "\t" << i + 1 << ". " << UGCDCallCourse[UGCDC[i]].name << endl; // Show courses chould be show name as it should show the prof later
}
cout << "\tFirst Degree Electives's" << endl;
for (int i = 0; i < UGELECT.size(); i++)
{
cout << "\t" << i + 1 << ". " << UGELECTallCourse[UGELECT[i]].name << endl; // Show courses chould be show name as it should show the prof later
}
cout << "\tHigher Degree CDC's" << endl;
for (int i = 0; i < HDCDC.size(); i++)
{
cout << "\t" << i + 1 << ". " << HDCDCallCourse[HDCDC[i]].name << endl; // Show courses chould be show name as it should show the prof later
}
cout << "\tHigher Degree Electives's" << endl;
for (int i = 0; i < HDELECT.size(); i++)
{
cout << "\t" << i + 1 << ". " << HDELECTallCourse[HDELECT[i]].name << endl; // Show courses chould be show name as it should show the prof later
}
}