Skip to content

About

A console-based Coffee Ordering System built in Java with multiple orders, customization options, input validation, price calculation, and receipt generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Coffee Ordering System ☕

A console-based Coffee Ordering System built using Java. The project allows users to place multiple coffee orders and customize each order with coffee type, size, quantity, whipped cream, and flavor shots. It also includes input validation, automatic price calculation, order details and price display, and a final receipt.

Features

  • Multiple coffee orders in a single session
  • Coffee type selection
  • Coffee size selection
  • Quantity selection
  • Whipped cream customization
  • Flavor shot customization
  • Vanilla and Hazelnut flavor options
  • Input validation for all menu choices
  • Automatic price calculation
  • Order details and price display
  • Final receipt with all orders
  • Total bill calculation

Coffee Options

☕ Coffee Types

  1. Espresso - ₹200
  2. Cappuccino - ₹250
  3. Latte - ₹300

📏 Coffee Sizes

  1. Small - ₹0
  2. Medium - ₹50
  3. Large - ₹80

🍦 Add-ons

  • Whipped Cream - ₹30

✨ Flavor Shots

  • Vanilla - ₹20
  • Hazelnut - ₹25

Concepts Used

  • Methods
  • Arrays
  • Loops
  • Conditional statements
  • Switch expressions
  • Scanner for user input
  • Input validation
  • Dynamic array creation based on user input
  • Return values from methods
  • Breaking a larger program into smaller methods

How It Works

  1. The program welcomes the user and asks how many coffee orders they want to place.
  2. Based on the number of orders entered, the program creates arrays of the required size to store the details of each order.
  3. For each order, the user selects the coffee type, coffee size, quantity, whipped cream, and whether to add a flavor shot.
  4. If a flavor shot is selected, the user chooses between Vanilla and Hazelnut.
  5. The program calculates the price of each order based on the selected coffee, size, add-ons, flavor, and quantity.
  6. The selected coffee, size, quantity, and calculated price are displayed for the order.
  7. After all orders are entered, the program generates a final receipt containing the details and price of each order.
  8. The total bill for all orders is calculated and displayed at the end.

How to Run

  1. Clone this repository.
  2. Open the project in IntelliJ IDEA or any Java-compatible IDE.
  3. Make sure Java is installed and configured.
  4. Run CoffeeOrderingSystem.java.
  5. Follow the instructions displayed in the console.

Example

****************************
☺ Welcome to Coffee Cafe! ☕
****************************

How many coffee orders would you like to place? 2

================= Order 1 =================

Choose your coffee:
1. Espresso - ₹200
2. Cappuccino - ₹250
3. Latte - ₹300

Enter your choice: 1

Choose your coffee size:
1. Small - ₹0
2. Medium - ₹50
3. Large - ₹80

Enter your choice: 1

Enter quantity: 1

Add whipped cream for ₹30? (yes=1 / no=0): 1

Add a flavor shot? (yes=1 / no=0): 1

Which one?
1. Vanilla - ₹20
2. Hazelnut - ₹25

Enter your choice: 1

You selected: Espresso (Small) x 1
Price: ₹250.0

================= Order 2 =================

Choose your coffee:
1. Espresso - ₹200
2. Cappuccino - ₹250
3. Latte - ₹300

Enter your choice: 2

Choose your coffee size:
1. Small - ₹0
2. Medium - ₹50
3. Large - ₹80

Enter your choice: 2

Enter quantity: 2

Add whipped cream for ₹30? (yes=1 / no=0): 1

Add a flavor shot? (yes=1 / no=0): 1

Which one?
1. Vanilla - ₹20
2. Hazelnut - ₹25

Enter your choice: 2

You selected: Cappuccino (Medium) x 2
Price: ₹710.0


==========================================
		☕ COFFEE CAFE ☕
==========================================

		ORDER RECEIPT

---------------------------------
Order 1
---------------------------------
Coffee            : Espresso
Size              : Small
Quantity          : 1
Whipped Cream     : Yes
Flavor            : Vanilla
Price             : ₹250.0

---------------------------------
Order 2
---------------------------------
Coffee            : Cappuccino
Size              : Medium
Quantity          : 2
Whipped Cream     : Yes
Flavor            : Hazelnut
Price             : ₹710.0

==========================================
Total Bill        : ₹960.0
==========================================

Thank you for visiting!
	☕

About

A console-based Coffee Ordering System built in Java with multiple orders, customization options, input validation, price calculation, and receipt generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages