- what does it need to know?
- what can it do?
- when does it do it?
get target_temprature
target_temperature = 72
repeat forever,
current_temperature = get_sensor_reading
if target_temperature > (current_temperature+5),
turn_on_heater
if target_temperature <= current_temperature,
turn_off_heater
- A vending machine offers a finite number of products.
- A customer may insert cash at any time to add credit.
- A customer may enter a product code at any time to request a purchase.
- A requested product requires N credit to purchase.
- A requested product may be out of stock.
- A purchase is triggered when a valid product code and sufficient credit has been entered.
- A purchase yeilds the requested product, and appropriate change.
- Full change may be requested at any time.