#include "stdafx.h" #include #include using namespace std; int main() { int numCourses, // Number of Courses sumCreditHoursTaken; // Hold the total number of credit hours the student is taking double total = 0, // Accumulator for total Credit hour costCreditHour // Default $147.00 this is the cost of hours 1 through 12 maxHoursFullTuition // Default 12, indicates hours 1 through 12 are at full tuition maintFeeAddOn // Default $29.33 indicates the cost of hours 13 and above tuitionCost // Regular cost premiumTuitionCost // Premium Cost //Function double gettuitionCost (double); double getpremiumTuitionCost (double); // Get the number of courses taken. cout << "This program calculates the cost of tuition.\n"; cout << "How many courses are you taking? "; cin >> numCourses; // Determine the total credit hours and accumulate a total for (int CreditHoursTaken = 1; CreditHoursTaken <= numCourses; CreditHoursTaken++) { int sumCreditHoursTaken; cout << "Enter credit hours for course " << CreditHoursTaken << ": "; cin >> sumCreditHoursTaken; total += sumCreditHoursTaken; } // Display the total Credit Hours Taken cout << "The total credit hours taken are " << total << endl; return 0; costCreditHour = 147.00 maxHoursFullTuition = 12 maintFeeAddOn = 29.33 } if (sumCreditHoursTaken <= maxHoursFullTuition) gettuitionCost = sumCreditHoursTaken * costCreditHour; else (sumCreditHoursTaken > maxHoursFullTuition) getpremiumTuitionCost = (maxHoursFullTuition * costCreditHour) + ((sumCreditHoursTaken - maxHoursFullTuition) * maintFeeAddOn); // Display the Cost. cout << "Your total tuition will be $" << endl; return 0; }