A console-based Vending Machine simulation built using Core Java. This project models real-world vending machine behavior including product selection, payment validation, and purchase handling.
- π Multiple product support (dynamic product list)
- π Product search based on user input
- π° Money insertion & validation
- π¦ Product availability check
- π³ Purchase processing
- πΈ Remaining balance returned to user
- βοΈ Clean and modular structure
-
User inserts money
-
User enters product name
-
System searches through all available products
-
If product is found:
- Checks if sufficient balance is available
- Deducts product price
- Dispenses product
- Returns remaining balance
-
If not found β shows error
Vender-Machine/
β
βββ src/
β βββ Main.java
β
βββ machine/
β βββ ProdsList.java
β
βββ users/
β βββ User.java
β
βββ .gitignore
βββ README.md
βββ LICENSE
βββ Vender-Machine.iml
βββ .idea/ (IDE config)
- Java (Core Java)
- OOP Concepts
- Streams API (for filtering/search)
- Clone the repository:
git clone https://github.com/your-username/vender-machine.git-
Open in IntelliJ IDEA or any Java IDE
-
Run:
Main.java
- Add product quantity (inventory system)
- Implement transaction history
- Add menu-driven interface
- Introduce enums for transaction types
- Improve error handling and validation
- Convert to GUI or web-based app
Contributions are welcome!
Feel free to:
- Fork the repo
- Create a feature branch
- Submit a Pull Request
This project is licensed under the MIT License.
This project is built as part of learning Java, OOP, and system design fundamentals.