Simple C# console project implementing Vending machine functionality
We will be designing a vending machine in this project.
User will insert coin into the machine, select an item to buy and the machine dispenses off the item.
Inputs -> insert coin, select item Output -> Get item
- Idle state : The machine starts off in this state and is not doing any action in this state.
- Processing State : The user inserts coin and selects item and machine starts processing.
- Sold State : The machine dispenses off the item to the user.
- Sold out state : The machine does not enough item to sell.
- Machine starts off in sold out state
- Once machine is loaded with certain default no of items it goes to idle state.
- When user selects item, machine goes to processing state from idle state.
- When user inserts coin, machine goes from processing state to sold state.
- Machine dispenses off the item and goes to idle state if it has enough items, else sold out state and waits to be refilled.