Vending Machine

Vending Machine

Vending Machine
This application simulates a vending machine that dispenses soft drinks.

• If the user clicks one of the money deposit buttons, this application adds the amount to the total deposited and updates the display.

• If the user clicks the Refund button, this application displays the amount refunded and resets the amount deposited to zero.

• If the user clicks a drink button and it is the last drink in stock, this application disables the button for that drink to indicate that it is out of stock.

• If the user clicks a drink button, but the user has not deposited enough money, this application displays how much more money needs to be deposited to purchase the drink.

• If the user clicks a drink button, and the user has deposited enough money, this application displays a message to enjoy the drink. In addition, if the user has deposited too much money, this application displays how much change is being returned.

Specifications

• The drinks cost $0.75.

• When this application is started, the vending machine has 2 of each drink in stock, and the buttons for all drinks are enabled.
Powered by