We require some software for installation in a European drink-dispensing machine. Here are the details: all items cost less than 1 euro (100 euro cents), and a 1 euro coin is the highest value that can be inserted. Given the amount inserted and the cost of the item, your program should give change, using the lowest number of coins. For example, if an item cost 45 cents and we paid with 100 cents, the result should be a series of message dialogs (one for each coin) of the form:
Number of 50 cent coins is 1
Number of 20 cent coins is 0
Number of 10 cent coins is 0
Number of 5 cent coins is 1
Number of 2 cent coins is 0
Number of 1 cent coins is 0
Hint: work in cents, and make extensive use of the % operator. The euro coins are:
100, 50, 20, 10, 5, 2, 1
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here