- InsertMoney (Money aCoin)
-
Tell the banker to add the amount of the coin to the current amount
Put the coin in the bank.
Get current amount from banker
Tell OutputDevice to display current amount
- PressCoinReturn
-
Ask the bank for an inventory
Ask the banker for change on current amount
// it will take the inventory
// it will return an array of
// type and quantity of each required for change
while there are values in the array from the bank
Ask the bank for that money
Give that money to the OutputDevice
- PressSodaButton (button_id)
-
Ask the can bin[button_id] if there is a can in that bin.
if the
Ask soda bin[button_id] for the current price.
Ask the Banker if there are sufficient funds
if yes
Get a can from bin[button_id]
Give can to output device
Tell banker to reduce amount by price
Ask the banker if we need to make change
if yes
DoCoinReturn
else
Tell oputput device to report insufficient funds
else
report out of that type soda
- The uml file. You will need to load it into umlet to see anything.
-