Designing and Coding a Vending Machine using Object Oriented Programming with the help of Hello Code's article on Designing a Vending Machine in Java
- Vending Machine displays a welcome message (products and prices)
- It asks the User to select a product
- Machine asks the user to enter coins (5, 10, 20, 50, or 100 cents)
- Machine calculates and totals up the amount enter by user
- It calculates the change based off the total and price of selected product
- It calculates minimum number of coins to return
- It displays a message with the change amount and coins
- Main
- Vending Machine
- Coin
- Accepting 5 different coins: 5 cents, 10 cents, twenty cents, fifty cents, hundred cents
- Product
- Representing the different products in our vending machine
- Calculator
- CoinBundle
- Help us return the change; if we need to return 2 10 cents, then we can have [0, 2, 0, 0, 0]; 5 fields for every different coin