The Coffee Machine program is designed following Object-Oriented Programming (OOP) principles. The Machine class encapsulates the functionality, protecting data related to the coffee machine's resource levels. It ensures that resource management and coffee preparation are handled efficiently and securely. The program uses the Coffee enumeration to define the different types of coffee available, allowing for easy selection of coffee options and providing clarity in the code.
The Coffee Machine is equipped with the following resources:
- Water tank (default capacity: 400ml)
- Milk container (default capacity: 540ml)
- Coffee beans container (default capacity: 120g)
- Disposable cups (default capacity: 9 cups)
- Cash (default amount: $550)
- Refill the water, milk, coffee beans, and disposable cups to keep the coffee machine stocked.
- Make four types of coffee: Espresso, Americano, Latte, and Cappuccino.
- Each coffee type has specific resource requirements, and the machine will check if there are enough resources before preparing the coffee. If there are insufficient resources, the machine prompts the user to refill accordingly.
- Clone the repository to your local machine.
- Open the Java project in your preferred Java IDE.
- Run the Main.java file to start the program.
- Choose the type of coffee you want to prepare.
- The machine will display the status of available resources and ask for a refill if necessary.
- Refill water, milk, coffee beans, or disposable cups if required.
- Collect money from the coffee machine.
Enjoy your freshly brewed coffee!