Question
Write a C++ program to calculate the change given to customer after a purchase. The program must prompt the user to input the cost of
Write a C++ program to calculate the change given to customer after a purchase. The program must prompt the user to input the cost of an item, the amount of money provided for payment. The program must then compute the amount of change and print the cost of the item, the amount of money provided by user for payment, and the amount of change as a dollar value using the dollar sign before the decimal value (remember to setprecision and fixed). Note that the tax rate on the cost is 5 percent and requires use of a constant variable. Call this value TAXRATE. The program should
Prompt the user for input values
Stores the values in variables called cost, cashGiven, and change
Stores the calculation of change in a variable called change
Prints the values of cost, cashGiven, and change along with identifying prompts. See below:
Change : $ 20.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started