Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Write a program to simulate a cash register change calculator. Assume that you have two double variables that have been declared and initialized with...

Write a program to simulate a cash register change calculator. Assume that you have two double variables that have been declared and initialized with some values: cost and amtPaid. Assume that amtPaid is greater than or equal to cost. cost represents the amount that the customer owes to the store, and amtPaid is the amount that the customer is giving to the store. Your program should calculate and print the total change due, and print how to give back the change.

For example, if cost is $52.32, and the amtPaid is $100, your program should print:

Your change is $47.68

2 $20 bill(s)

1 $5 bill(s)

2 $1 bill(s)

2 Quarter(s)

1 Dime(s)

1 Nickel(s)

3 Penny(ies)

You don't have to use dollar amounts greater than $20 in giving back your change. Your code should not print anything for a change amount that is not used; for example, do not print "0 $10 bill(s)" in the example shown above.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question