Question: Task #2: Cash Register Change Write a program that tells what coins to give out to a customer for any amount of change from 1


Task #2: Cash Register Change Write a program that tells what coins to give out to a customer for any amount of change from 1 cent to 99 cents. For example: if the amount of change is 99 cents then the output would be : 3 quarters, 2 dimes, 0 nickels, and 4 pennies. Your code should contain: . a main function . a function called change Function change(numberOfCoins, money, coinValue); . declare 4 constants that represent the value of the 4 coins(QUARTER =25, DIME = 10, NICKEL = 5, PENNY =1) . incorporate an iteration method that asks the user "Again?" int main() // declarations change(quarters, money, QUARTER); change(dimes, money , DIME); //output Test cases:Test cases: Enter the amount of change in cents:99 The amount 99 cents in coins is: 3 quarters, 2 dimes, 0 nickels, 4 pennies Again? Y Enter the amount of change in cents:54 The amount 54 cents in coins is: 2 quarters, 0 dimes, 0 nickels, 4 pennies Again? Y Enter the amount of change in cents:9 The amount 9 cents in coins is: 0 quarters, 0 dimes, 1 nickels, 4 pennies Again? N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
