Vending Machine exercise
Problem Statement:
Design a vending machine that works as follows:
-
Once an item is selected and the appropriate amount of money is inserted, the vending machine should return the correct product.
-
It should also return change if too much money is provided, or ask for more money if insufficient funds have been inserted.
-
The machine should take an initial load of products and change. The change will be of denominations 1c, 2c, 5c, 10c, 20c, 50c, €1, €2.
-
There should be a way of reloading either products or change at a later point.
-
The machine should keep track of the products and change that it contains.