Advertisement
Guest User

Untitled

a guest
Oct 30th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #include <iostream>
  2. #include "Time.h"
  3. #include "Date.h"
  4. #include "Course.h"
  5. #include "CourseSchedule.h"
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. string name, semester, courseNumber, courseName, meetingDays;
  12. float units;
  13. int numberOfClasses;
  14. char selection;
  15. Time startClassTime, endClassTime;
  16. Date startClassDate, endClassDate;
  17.  
  18. cout << "Enter your name: ";
  19. getline(cin, name);
  20.  
  21. cout << "What semester are you entering for? ";
  22. getline(cin, semester);
  23.  
  24. cout << "What is the maximum amount of classes a student is able to take? ";
  25. cin >> numberOfClasses;
  26.  
  27. CourseSchedule student(name, semester, numberOfClasses);
  28.  
  29.  
  30. for (int o = 0; o < numberOfClasses; o++)
  31. {
  32. cout << endl << "COURSE ENTRY MENU FOR: " << semester << endl
  33. << "-------------------------------------------------" << endl
  34. << "1) Enter a new course" << endl
  35. << "2) Print a complete semester schedule for: " << semester << endl
  36. << "q) Quit the program" << endl << endl;
  37.  
  38. cin >> selection;
  39.  
  40. if( selection == '1' )
  41. {
  42. cout << "What is the course number? ";
  43. getline(cin, courseNumber);
  44.  
  45. cout << "What is the course name? ";
  46. getline(cin, courseName);
  47.  
  48. cout << "What are the meeting days? ";
  49. getline(cin, meetingDays);
  50.  
  51. cout << "How many units is the class worth? ";
  52. cin >> units;
  53.  
  54. cout << "What is the starting time of the class? ";
  55. cin >> startClassTime;
  56.  
  57. cout << "What is the ending time of the class? ";
  58. cin >> endClassTime;
  59.  
  60. cout << "What is the starting date of the class? ";
  61. cin >> startClassDate;
  62.  
  63. cout << "What is the ending date of the class? ";
  64. cin >> endClassDate;
  65.  
  66. Course a(courseNumber, courseName, meetingDays, units, startClassDate, endClassDate, startClassTime, endClassTime);
  67.  
  68. student.AddCourse(a);
  69.  
  70. }
  71.  
  72. else if ( selection == '2' )
  73. {
  74. cout << student;
  75. }
  76.  
  77. else if( selection == 'q' || selection == 'Q')
  78. {
  79. break;
  80. }
  81.  
  82. else
  83. {
  84. cout << "Invalid choice. Please select either 1, 2, or Q." << endl;
  85. o--;
  86. }
  87. }
  88.  
  89.  
  90. return 0;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement