Question: Code pref in C++ please 11THE MAKING CHANGE PROBLEM Write a function named makeChange() that takes two double input parameters, cost and amount, along with
11THE MAKING CHANGE PROBLEM Write a function named makeChange() that takes two double input parameters, cost and amount, along with three int output parameters: quarters (25 cents), dimes (10 cents) and cents. We'll skip using nickels (5 cent coins) for this problem. The cost is the cost of your purchases, and the amount is the amount you give to the cashier. Your function will calculate the change after subtracting the cost of the purchases from the amount. The output variables quarters, dimes and cents will be used for to return the coins and the return statement will be used to return the dollars. Here's an example. Your purchases are S1.08 and you pay with a S5.00 bill. Your change is: int quarters, dimes, cents int dollars makeChange(1.08, 5.00, quarters, dimes, cents); cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
