I'm working on a program that needs to calculate the total cost of tuition.
Enter amount of credits -- multiply credits by 100.00 -- add 20.00 as student activity fee -- print final number.
I can get the program to work the following way:
When I try to break down the processes in functions I get some number with E in it.Code:#include <iostream>
using namespace std;
int main()
{
int iCredits;
double fTotal;
cout << "Please enter a the number of credits you are taking this semester: ";
cin >> iCredits;
cout << "$ " << iCredits * 100 + 20 << endl;
system("PAUSE");
return 0;
}
Can anyone help me with a suggestion to break down the above program using multiple functions? One to compute credits * 100.00, one to add the extra 20.00 and finally one to print out the final total.