Welcome to the Java Vending Machine project! This is a simple command-line application that simulates a vending machine where users can insert coins, select products, and receive their chosen item if they have enough balance.
The Java Vending Machine is a basic application written in Java. It provides a textual interface for users to interact with the vending machine, make selections, and receive products if they have enough balance. The application uses simple command-line input and output for user interactions.
To use the Java Vending Machine, follow these steps:
- Clone the repository to your local machine.
- Open the project in your Java development environment (e.g., Visual Studio Code).
- Compile the
VendingMachine.java
file. - Run the compiled Java program to start the vending machine.
- Follow the on-screen instructions to interact with the vending machine.
- Enjoy your selected products!
The Java Vending Machine offers the following features:
- Inserting coins into the machine.
- Displaying available products and their prices.
- Selecting a product for purchase.
- Checking the balance after inserting coins.
- Handling insufficient funds and displaying appropriate messages.
Before running the Java Vending Machine, make sure you have the following prerequisites installed on your system:
- Java Development Kit (JDK): Download JDK or OpenJDK.
- Integrated Development Environment (IDE) like Visual Studio Code: Download VSCode.
The Java Vending Machine project includes a set of JUnit tests to ensure the correctness of its functionality. These tests are located in the VendingMachineTest.java
file.
To run the tests, follow these steps:
- Open the project in your Java development environment (e.g., Visual Studio Code).
- Navigate to the
VendingMachineTest.java
file. - Right-click on the file and select "Run Test" to execute all test cases.
- The test results will be displayed in the test runner.
Contributions to the Java Vending Machine project are welcome! If you find any issues or have ideas to improve the application, feel free to open an issue or create a pull request.
When contributing, please follow the existing code style and conventions.