-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
83 lines (66 loc) · 1.89 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
C867-Scripting and Programming: Applications
Language: C++
David Sainvilus
StudentID: 001049272
*/
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include "Student.h"
#include "Degree.h"
#include "Roster.h"
using namespace std;
int main()
{
const string studentData[] = {
"A1,John,Smith,John1989@gm ail.com,20,30,35,40,SECURITY",
"A2,Suzan,Erickson,Erickson_1990@gmailcom,19,50,30,40,NETWORK",
"A3,Jack,Napoli,The_lawyer99yahoo.com,19,20,40,33,SOFTWARE",
"A4,Erin,Black,[email protected],22,50,58,40,SECURITY",
"A5,David,Sainvilus,[email protected],27,32,11,23,SOFTWARE"
};
//Creating Roster Instance
Roster classRoster;
// Creating Degree Instance
Degree myDegree;
// adding each student to the classRoster
for (int i = 0; i < 5; i++) {
stringstream ss(studentData[i]);
vector<string> result;
while (ss.good()) {
string substr;
getline(ss, substr, ',');
result.push_back(substr);
}
if (result[8] == "NETWORK") {
myDegree = Degree::NETWORKING;
}
if (result[8] == "SECURITY") {
myDegree = Degree::SECURITY;
}
if (result[8] == "SOFTWARE") {
myDegree = Degree::SOFTWARE;
}
classRoster.add(result[0], result[1], result[2], result[3], stoi(result[4]), stoi(result[5]),
stoi(result[6]), stoi(result[7]), myDegree);
}
//print Personal Info
cout << "C867-Scripting and Programming: Applications" << endl;
cout << "Language: C++" << endl;
cout << "StudentID: 001049272" << endl;
cout << "Name: David Sainvilus" << endl;
cout << endl;
// printing all results
classRoster.printAll();
classRoster.printBadEmails();
for (int i = 0; i < 5; i++)
{
classRoster.printnumDays(classRoster.classRosterArray[i]->getStudentID());
}
classRoster.printByDegree("SOFTWARE");
classRoster.remove("A3");
classRoster.printAll();
classRoster.remove("A3");
}