Guest User

Untitled

a guest
May 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. void studentType::print(ostream& outF, double tuitionRate)
  2. {
  3. int i;
  4.  
  5. outF << "Student Name: " << getFirstName()
  6. << " " << getLastName() << endl; //Step 1
  7. cout << "Student Name: " << getFirstName()
  8. << " " << getLastName() << endl;
  9. outF << "Student ID: " << sId << endl; //Step 2
  10.  
  11. cout << "Student ID: " << sId << endl;
  12. outF << "Number of courses enrolled: "
  13. << numberOfCourses << endl; //Step 3
  14. cout << "Number of courses enrolled: "
  15. << numberOfCourses << endl;
  16. outF << endl;
  17. cout << endl;
  18. outF << left;
  19. cout << left;
  20. outF << "Course No" << setw(15) << " Course Name"
  21. << setw(8) << "Credits"
  22. << setw(6) << "Grade" << endl; //Step 4
  23.  
  24. cout << "Course No" << setw(15) << " Course Name"
  25. << setw(8) << "Credits"
  26. << setw(6) << "Grade" << endl;
  27. outF << right;
  28. cout << right;
  29.  
  30. for (i = 0; i < numberOfCourses; i++) //Step 5
  31. {
  32. coursesEnrolled[i].print(outF); //Step 5a
  33.  
  34. if (isTuitionPaid) //Step 5b
  35. outF <<setw(4) << coursesGrade[i] << endl;
  36. cout <<setw(4) << coursesGrade[i] << endl;
  37. else
  38. outF << setw(4) << "***" << endl;
  39. cout << setw(4) << "***" << endl;
  40. }
  41. outF << endl;
  42. cout << endl;
  43.  
  44. outF << "Total number of credit hours: "
  45. << getHoursEnrolled() << endl; //Step 6
  46.  
  47. cout << "Total number of credit hours: "
  48. << getHoursEnrolled() << endl;
  49. outF << fixed << showpoint << setprecision(2); //Step 7
  50. cout << fixed << showpoint << setprecision(2);
  51.  
  52. if (isTuitionPaid) //Step 8
  53. outF << "Mid-Semester GPA: " << getGpa()
  54. << endl;
  55. cout << << "Mid-Semester GPA: " << getGpa()
  56. << endl;
  57.  
  58. else
  59. {
  60. outF << "*** Grades are being held for not paying "
  61. << "the tuition. ***" << endl;
  62.  
  63. outF << "Amount Due: $" << billingAmount(tuitionRate)
  64. << endl;
  65. cout << "*** Grades are being held for not paying "
  66. << "the tuition. ***" << endl;
  67. cout << "Amount Due: $" << billingAmount(tuitionRate)
  68. << endl;
  69.  
  70. }
  71.  
  72. outF << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
  73. << "-*-*-*-*-" << endl << endl;
  74. cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
  75. << "-*-*-*-*-" << endl << endl;
Add Comment
Please, Sign In to add comment