A particular college charges $118.22 per credit. Ask the user how many credits he/she is taking this semester and calculate what the total charges for that semester are.
Output:
How many credits are you taking this semester? (assume user inputs 3)
Your total charges for this semester are $354.66
#include <iostream>
using namespace std;
int main () {
const float per_credit = 118.22;
int credit;
cout << "How many credits are you taking this semester? ";
cin >> credit;
cout << "Your total charges for this semester are $" << per_credit * credit;
return 0;
}
Comments
Leave a comment