subject

Write a program that simulates the functionality of a vending machine having the following characteristics:• The vending machine offers 5 products• The vending machine accepts coins, 1 dollar bills, and 5 dollar bills• The change is always given in coins, with maximum possible number of coins in each value: 25, 10, 5 or 1 cent.• The selections available for user are numbers from 1 to 5.• The user enters the money – simulate the action through a loop that ends when the user enters 0. Each coin, or paper bill will be read individually.• The user makes the selection, and the machine allows a maximum 4 other selections if the amount entered doesn’t cover the price of the item.• Once an item is delivered, the machine gives the change in coins.• There is no increment for the money during one selection.• The user can stop the selection at any time by entering 0 for the product selection.• If the user chooses to cancel the selection, the machine returns the initial amount in coins.• Display the outcome of the operation for each alternative you consider possible for the vending machine.• Make sure that the machine returns the correct change at all times.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 23:30
Does anyone have the problem where you try to watch a video to get your answer but it brings up a thing asking your gender to make ads relevant but it doesn't load? btw i won't be able to see the answer so use the comments .
Answers: 1
question
Computers and Technology, 25.06.2019 14:00
Do the shape of a sign gives you a clue about the information contained on the sign
Answers: 1
question
Computers and Technology, 25.06.2019 15:30
If a 120 v appliance requires 15 a to operate, what is the resistance of the appliance?
Answers: 1
question
Computers and Technology, 25.06.2019 17:00
Ineed on this it's not really a subject it's drivers edd
Answers: 1
You know the right answer?
Write a program that simulates the functionality of a vending machine having the following character...
Questions
question
Mathematics, 18.10.2019 12:00
question
Mathematics, 18.10.2019 12:00
question
History, 18.10.2019 12:00
Questions on the website: 13722360