-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (48 loc) · 2.16 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
#include "roster.h"
#include "student.h"
int main()
{
// Print out to the screen, via your application, the course title, the programming language used, your WGU student ID, and your name.
cout << "Scripting and Programming - Applications\tC++\t010762848\tEric Crow" << std::endl << std::endl;
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,Eric,Crow,[email protected],26,3,6,9,SOFTWARE"
};
const int numStudents = 5;
// Create an instance of the Roster class called classRoster.
Roster classRoster;
// Add each student to classRoster.
for (int i = 0; i < numStudents; i++) classRoster.parse(studentData[i]);
// classRoster.printAll();
cout << "*Displaying all students* " << std::endl;
classRoster.printAll();
cout << std::endl;
// classRoster.printInvalidEmails();
cout << "*Displaying students with invalid emails*" << std::endl;
classRoster.printInvalidEmails();
cout << std::endl;
// loop through classRosterArray and for each element: classRoster.printAverageDaysInCourse(/*current_object's student id*/);
cout << "*Displaying average days students spent in course* " << std::endl;
cout << "Student ID|Average Days Spent in Course" << std::endl;
for (int i = 0; i <= 4; i++) {
classRoster.printAverageDaysInCourse(classRoster.classRosterArray[i]->getStudentID());
}
cout << std::endl;
// classRoster.printByDegreeProgram(SOFTWARE);
cout << "*Displaying by degree program: SOFTWARE*" << std::endl;
classRoster.printByDegreeProgram(SOFTWARE);
// classRoster.remove("A3");
cout << "*Removing student with ID A3*" << std::endl;
classRoster.remove("A3");
cout << std::endl;
// classRoster.remove("A3"); should display ID not found;
cout << "*Removing student with ID A3*" << std::endl;
classRoster.remove("A3");
cout << std::endl;
system("pause");
return 0;
}