Skip to content

Experience the workings of a coffee machine through a sophisticated simulation. This program encapsulates its operations within a single method, orchestrating a seamless interaction based on the machine's dynamic state.

Notifications You must be signed in to change notification settings

mercerclayton/coffee-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coffee Machine

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.

Features:

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)

The program allows users to:

  • 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.

How to Use:

  • 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.

Follow the on-screen prompts to interact with the Coffee Machine:

  • 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!

About

Experience the workings of a coffee machine through a sophisticated simulation. This program encapsulates its operations within a single method, orchestrating a seamless interaction based on the machine's dynamic state.

Topics

Resources

Stars

Watchers

Forks

Languages