- Judy Abuquta
- Sarah Eid
- Abeer Hussain
- Effat University, College of Engineering, Computer Science Department
- Jeddah, Saudi Arabia
This project demonstrates a console-based restaurant ordering system implemented entirely in Java using object-oriented programming principles. It allows users to interact with a restaurant menu, place orders, calculate totals, and process payments. The project emphasizes clean OOP design with classes responsible for distinct functionalities.
-
To simulate a real-world restaurant ordering workflow, including:
-
Selecting order types (Dine-in, Takeaway, Delivery)
-
Adding multiple menu items with quantities
-
Calculating totals including delivery fees
-
Generating a detailed receipt
-
Processing payment with support for partial payments and change calculation
-
Object-Oriented Programming (Java)
-
Class design and encapsulation (Menu, Order, Bill)
-
Separation of concerns and single responsibility
-
Map-based menu and order management
-
Input validation and error handling
-
Dynamic receipt generation with subtotals and delivery fees
├── OrderingSystem.java # Main program flow / user interface
└── com/
├── Menu.java # Menu items and prices
├── Order.java # Stores selected items, quantities, and fees
└── Bill.java # Calculates totals, prints receipt, processes payment
OrderingSystem.java Guides the user through selecting an order type Accepts menu item selections and quantities Captures delivery details for delivery orders Calls Bill to print a detailed receipt and handle payment
Menu.java Stores menu items and their prices in a map Provides getter methods for prices and items
Order.java Stores selected items and quantities Tracks delivery location, pickup branch, and delivery fees Provides getters/setters for encapsulation
Bill.java Calculates subtotal for each item Adds delivery fee if applicable Prints a formatted receipt Handles payment input, supports partial payments and calculates change Optional: Can implement Payable interface for polymorphic payment handling
Example Receipt:
==================== RECEIPT ====================
Item Qty Price Subtotal
-------------------------------------------------
Burger 2 $8.99 $17.98
Coca-Cola 1 $1.50 $1.50
-------------------------------------------------
Delivery Fee: $5.00
-------------------------------------------------
TOTAL: $24.48
=================================================
-
Compile all Java files: javac OrderingSystem.java com/*.java
-
Run the program: java OrderingSystem
-
Follow prompts to select order type, add items, and process payment