[SOLVED] CSE110-Mod 3 Change Return

20.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

We’ve developed a new cash register and like most machines, it subtracts the amount owed from the amount received to determine how much money the cashier must return to the customer. However, to avoid some human error, we automatically return the correct change through a coin dispenser. As our company’s only software engineer, you need to write the code this function.

You are to accept two amounts: the amount owed, and the amount received. Print a series of messages indicating how many dollars, quarters, dimes, nickels and cents are to be returned. For the dollar amount, just specify a whole number. It is not necessary to break it up into $10s, $5s or $1s. Also note that our coin dispenser does not hand out dollar coins or 50 cent pieces.

If the user provides less than the amount owed, print an error message which includes the amount short and terminate the program. The error message should look something like the following:

*** You did not provide enough money. You are $1.45 short. ***

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.