Answer to Question #159421 in C++ for Earl Davis Jr.

Question #159421

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


1
Expert's answer
2021-01-29T01:34:51-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog