Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. // printStudentInfo
  2. void Student::printStudentInfo()
  3. {
  4. auto iter = coursesCompleted.begin();
  5. auto iterEnd = coursesCompleted.end();
  6.  
  7. cout << "Student Name: ";
  8. Person::printName();
  9. cout << endl << endl;
  10. cout << "Student ID: " << studentID << endl;
  11. cout << "Number of courses completed: " <<
  12. static_cast<int>(coursesCompleted.size());
  13. cout << endl << endl;
  14.  
  15. cout << "Course" << setw(10) << "Units" << setw(10) << "Grade" << endl;
  16.  
  17. int unitHours = 0;
  18.  
  19. while (iter != iterEnd)
  20. {
  21. cout << iter->first.getCoursePrefix() << " "
  22. << iter->first.getCourseNo() << setw(9);
  23.  
  24. cout << fixed << setprecision(2) << iter->first.getCourseUnits();
  25.  
  26. if (tuitionWasPaid) cout << setw(8) << iter->second << endl;
  27. else cout << setw(10) << "***" << endl;
  28.  
  29. unitHours += static_cast<int>(iter->first.getCourseUnits());
  30. ++iter;
  31. }
  32.  
  33. cout << endl << endl;
  34. cout << "Total number of unit hours: " << unitHours << endl;
  35.  
  36. if (tuitionWasPaid) cout << "Current Term GPA: " << getGpa() << endl;
  37. else cout << "*** Grades are being held for not paying "
  38. << "the tuition. ***" << endl;
  39.  
  40. cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-" << endl;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement