Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void studentType::print(ostream& outF, double tuitionRate)
- {
- int i;
- outF << "Student Name: " << getFirstName()
- << " " << getLastName() << endl; //Step 1
- cout << "Student Name: " << getFirstName()
- << " " << getLastName() << endl;
- outF << "Student ID: " << sId << endl; //Step 2
- cout << "Student ID: " << sId << endl;
- outF << "Number of courses enrolled: "
- << numberOfCourses << endl; //Step 3
- cout << "Number of courses enrolled: "
- << numberOfCourses << endl;
- outF << endl;
- cout << endl;
- outF << left;
- cout << left;
- outF << "Course No" << setw(15) << " Course Name"
- << setw(8) << "Credits"
- << setw(6) << "Grade" << endl; //Step 4
- cout << "Course No" << setw(15) << " Course Name"
- << setw(8) << "Credits"
- << setw(6) << "Grade" << endl;
- outF << right;
- cout << right;
- for (i = 0; i < numberOfCourses; i++) //Step 5
- {
- coursesEnrolled[i].print(outF); //Step 5a
- if (isTuitionPaid) //Step 5b
- outF <<setw(4) << coursesGrade[i] << endl;
- cout <<setw(4) << coursesGrade[i] << endl;
- else
- outF << setw(4) << "***" << endl;
- cout << setw(4) << "***" << endl;
- }
- outF << endl;
- cout << endl;
- outF << "Total number of credit hours: "
- << getHoursEnrolled() << endl; //Step 6
- cout << "Total number of credit hours: "
- << getHoursEnrolled() << endl;
- outF << fixed << showpoint << setprecision(2); //Step 7
- cout << fixed << showpoint << setprecision(2);
- if (isTuitionPaid) //Step 8
- outF << "Mid-Semester GPA: " << getGpa()
- << endl;
- cout << << "Mid-Semester GPA: " << getGpa()
- << endl;
- else
- {
- outF << "*** Grades are being held for not paying "
- << "the tuition. ***" << endl;
- outF << "Amount Due: $" << billingAmount(tuitionRate)
- << endl;
- cout << "*** Grades are being held for not paying "
- << "the tuition. ***" << endl;
- cout << "Amount Due: $" << billingAmount(tuitionRate)
- << endl;
- }
- outF << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
- << "-*-*-*-*-" << endl << endl;
- cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
- << "-*-*-*-*-" << endl << endl;
Add Comment
Please, Sign In to add comment