OO Programming in Java


Problem Statement:

Design an object model for a soda vending machine. Draw a scenario diagram for 'buying a soda'. Assume only one type of soda will be dispensed.

The machine accepts coins, determines the value of coins deposited, dispenses the soda when the "Dispense" button is pressed, returns change if necessary and allows all deposited coins to be returned before purchase via the "Coin Return" button. Two lights are used to convey information to the consumer, a "Sold out" light and a "Use exact change" light.