This is a Java-based CLI program that simulates a vending machine. It allows users to view available products, feed money into the machine, select a product to purchase, and receive change.
The project is created with:
- Java
- OOP
- File I/O
- JUnit
- IntelliJ
To install the Vending-Machine-App, follow these steps:
-
Download and install IntelliJ IDEA if you haven't done so already. You can download it from the official JetBrains website. The free Community version will suffice for running this application.
-
Open IntelliJ IDEA, on the Welcome screen, click on "Get from VCS".
-
In the "URL" field, paste the URL of the GitHub repository and click "Clone".
-
Once the project is cloned and loaded, open the Project window by going to "View" -> "Tool Windows" -> "Project" and navigate to the
VendingMachineCLI.java
file located undersrc/com/techelevator
. -
Right-click on the
VendingMachineCLI.java
file in the Project window and select "Run 'VendingMachineCLI.main()'" from the context menu. -
The program will now execute in IntelliJ's built-in console.
If the project has any dependencies (like external libraries or modules), they should be managed by IntelliJ automatically. However, if there are any issues with dependencies or project setup, you may need to manually resolve them in IntelliJ's Project Structure window (File -> Project Structure).
- Product Listing: Users can view available products in the vending machine.
- Money Feeding: Users can feed money into the machine in whole dollar amounts.
- Product Selection: Users can select a product to purchase.
- Transaction Logging: All transactions are logged to prevent theft.
To use the Vending Machine program, follow these steps:
- Run the program. This will present you with a main menu, where you can choose to display items, purchase items, or exit the program.
- To view available items, select the "Display Vending Machine Items" option. This will list all items available for purchase.
- To purchase an item, select the "Purchase" option. This will present you with another menu, where you can choose to feed money, select a product, or finish the transaction.
- To feed money into the machine, select the "Feed Money" option and follow the prompts.
- To select a product, choose the "Select Product" option, and follow the prompts.
- Once you have selected your product and paid, you can choose the "Finish Transaction" option to complete your purchase and receive your change.
If you encounter any issues while using the Vending Machine program, try the following troubleshooting tips:
- Ensure you have the latest version of Java installed.
- Check for error messages in the console.
- If all else fails, try restarting the application.