A console-based coffee machine simulator built with Python 3.11.
This application simulates a coffee machine that allows users to:
- Order Latte, Espresso, or Cappuccino
- Pay using virtual coins (quarters, dimes, nickels, pennies)
- Receive change when applicable
- Automatically update available ingredients after each transaction
- Three available drinks:
latte
,espresso
,cappuccino
- Payment system with coin input & automatic change calculation
- Resource tracking for water, milk, coffee, and money collected
- Manager commands:
off
→ turns off the machinereport
→ prints current resources and profit report
Sample Report Output: Water: 100ml Milk: 50ml Coffee: 76g Money: $2.5
The project is structured into three classes:
Menu
– handles the drink options and menu displayCoffeeMaker
– manages ingredients and coffee preparationMoneyMachine
– handles payments, change, and transactions
Workflow:
- User is asked: “What would you like? (latte/espresso/cappuccino)”
- App checks ingredient availability
- User deposits coins
- App verifies sufficient funds & resources
- Coffee is dispensed ☕ → “Enjoy your drink!”
- Written in Python 3.11
- No external libraries required
- Runs directly in the Python console
Clone this repository and open it in your IDE:
git clone git@github.com:your-username/coffee-machine.git
cd coffee-machine
Run the application in your Python console:
python main.py