Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Time.h"
- #include "Date.h"
- #include "Course.h"
- #include "CourseSchedule.h"
- using namespace std;
- int main()
- {
- string name, semester, courseNumber, courseName, meetingDays;
- float units;
- int numberOfClasses;
- char selection;
- Time startClassTime, endClassTime;
- Date startClassDate, endClassDate;
- cout << "Enter your name: ";
- getline(cin, name);
- cout << "What semester are you entering for? ";
- getline(cin, semester);
- cout << "What is the maximum amount of classes a student is able to take? ";
- cin >> numberOfClasses;
- CourseSchedule student(name, semester, numberOfClasses);
- for (int o = 0; o < numberOfClasses; o++)
- {
- cout << endl << "COURSE ENTRY MENU FOR: " << semester << endl
- << "-------------------------------------------------" << endl
- << "1) Enter a new course" << endl
- << "2) Print a complete semester schedule for: " << semester << endl
- << "q) Quit the program" << endl << endl;
- cin >> selection;
- if( selection == '1' )
- {
- cout << "What is the course number? ";
- getline(cin, courseNumber);
- cout << "What is the course name? ";
- getline(cin, courseName);
- cout << "What are the meeting days? ";
- getline(cin, meetingDays);
- cout << "How many units is the class worth? ";
- cin >> units;
- cout << "What is the starting time of the class? ";
- cin >> startClassTime;
- cout << "What is the ending time of the class? ";
- cin >> endClassTime;
- cout << "What is the starting date of the class? ";
- cin >> startClassDate;
- cout << "What is the ending date of the class? ";
- cin >> endClassDate;
- Course a(courseNumber, courseName, meetingDays, units, startClassDate, endClassDate, startClassTime, endClassTime);
- student.AddCourse(a);
- }
- else if ( selection == '2' )
- {
- cout << student;
- }
- else if( selection == 'q' || selection == 'Q')
- {
- break;
- }
- else
- {
- cout << "Invalid choice. Please select either 1, 2, or Q." << endl;
- o--;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement