Question: Suppose that a vending machine sells all items for 5 0 cents and only accepts coins in these denominations: 2 5 cents, 1 0 cents,
Suppose that a vending machine sells all items for cents and only accepts coins in these denominations: cents, cents, and cents.
Implement a program that prompts the user to insert a coin, one at a time, each time informing the user of the amount due. Once the user has inputted at least cents, output how many cents in change the user is owed. Assume that the user will only input integers, and ignore any integer that isnt an accepted denomination.
Program Requirements
Prompt user for input Insert Coin: until the total the user has entered is greater than or equal to
If total payment is less than inform user of amount still due.
Once payment is greater than or equal to print the amount of change owed to the user.
Ignore integers that are not in the following denominations: cents, cents, and cents.
Must include comments with your name, date, program name, and program purpose.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
