Constructor functions for your button events as outlined


Vending Machine

You must use The following:

constructor functions for your button events as outlined

prototype objects

User interface

Interface.JPG

Operation

• 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.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Constructor functions for your button events as outlined
Reference No:- TGS01374282

Now Priced at $40 (50% Discount)

Recommended (90%)

Rated (4.3/5)