Restaurant Management System
Student Name: Argha Mukherjee
Roll Number: 10800223044
Department: Information Technology
Institution: Asansol Engineering College
Course & Semester: Object-Oriented Programming – Semester [5]
1|Page
Table of Contents
Sl.no Topic Pg.no
1. 3
Abstract
2. Introduction 4
3. Problem Definition 5
4. Methodology 7
4.1 OOP Concepts Applied
4.2 Class Design
4.3 Data Flow and UML Diagram
4.4 Algorithm Explanation
5. Source Code 10
6. Outcomes 14
7. Conclusion and Future Work 15
8. References 17
2|Page
1.Abstract
The Restaurant Management System (RMS) is developed using Object-
Oriented Programming (OOP) in Java to automate the management of table
bookings, customer orders, and revenue calculation in a restaurant.
The system handles 7 tables, with hourly booking slots between 11:00 AM and
11:00 PM.
Key functionalities include:
Managing table reservations to prevent double-bookings.
Recording and tracking customer orders with itemized details and total
amounts.
Displaying table occupancy status for any date and time slot.
Calculating the total revenue collected per day.
Identifying the top-spending customer of the day.
Printing customer booking and order details.
OOP concepts like encapsulation, inheritance, and polymorphism are applied
to ensure a modular, scalable, and maintainable design.
The system demonstrates efficient data handling and provides clear reports,
forming a strong foundation for future enhancements such as GUI integration,
database connectivity, and online payments.
3|Page
2.Introduction
Importance of Management Systems in Hospitality
In the hospitality industry, efficient management systems are critical for
handling bookings, orders, billing, and reporting.
Manual processes are prone to:
Human errors
Time delays
Inefficient customer service
An automated management system ensures:
Real-time availability checking
Organized customer order management
Automated revenue tracking
Accurate reporting of occupancy and sales
Relevance of Object-Oriented Programming in System Design
OOP helps represent real-world entities as classes, making the system
modular and scalable:
Encapsulation: Data hiding improves security and reduces complexity.
Inheritance: Promotes code reusability.
Polymorphism: Simplifies method handling by overloading and
overriding.
Abstraction: Focuses on essential system features.
Overview of Restaurant Booking and Order Management
The system tracks each table’s status (booked or free) per time slot and day.
It manages customer records, records food orders per booking, and tracks
daily revenue and top customers.
4|Page
3. Problem Definition
3.1 Challenges in Managing Table Reservations and Orders
Table Double Booking: Prevent the same table being booked multiple
times for the same time slot.
Order Tracking: Keep track of multiple orders without missing items.
Revenue Calculation Errors: Ensure revenue calculation is accurate and
error-free.
Customer Reporting: Generate customer reports instantly when needed.
3.2 Input Requirements
Field Name Description
Customer ID Unique identification number for each customer.
Customer Name Full name of the customer.
Phone Number Contact number.
Date Booking date in format DDMMYYYY (e.g.,
10092025).
Time Slot Hourly time slot for booking (e.g., 11:00–12:00).
Allocated Table Table number (from 1 to 7).
No
Order Items List of ordered food items (e.g., Burger, Pizza,
Salad).
Order Amount The total amount calculated from food item
prices.
5|Page
3.3 Expected System Outputs
Output Type Description
Food Menu Displays food items with prices.
Occupancy Table Shows booked or available tables per date and
time slot.
Booking Record Customer name, table number, time slot, order
details stored.
Daily Revenue Total sum of orders for a particular day.
Top-Spending Customer with the highest order amount in a
Customer day.
Full Customer Print all details of customers per booking or as
Details a report.
6|Page
4. Methodology
4.1 OOP Concepts Applied
Classes and Objects: Each key entity is represented by a class with
attributes and behaviors (methods).
Encapsulation: Private data with getters and setters to control data access.
Inheritance: Base class inheritance for shared functionality.
Polymorphism: Overloaded methods for flexibility.
4.2 Class Design
Customer Class
Attributes: customerID, name, phoneNumber.
Methods: Getter and setter methods to retrieve or update customer details.
Order Class
Attributes: List of food items, total order amount, booking date, time slot.
Methods: Add items, calculate order total.
Table Class
Attributes: tableNumber, isBooked.
Methods: Book table, release table, check availability.
RestaurantSystem Class
Attributes: Collection of tables, customers, and orders.
Methods:
o displayMenu()
o bookTable()
o showOccupancy()
o calculateRevenue()
7|Page
o getTopSpendingCustomer()
o printCustomerDetails()
4.3 Data Flow
4.4 Algorithm Explanation
Booking Algorithm
1. Receive input: customer info, date, time slot, table number.
2. Check if table is free for given date and time.
3. If free, create booking and store order details.
4. Else, reject with an appropriate message.
Revenue Calculation Algorithm
1. Loop through all orders.
2. If order’s date matches the requested date, sum order amounts.
3. Output total revenue.
Top-Spending Customer Algorithm
1. Iterate customer orders grouped by customer ID.
8|Page
2. Calculate total spending per customer for a day.
3. Return customer with the maximum total.
9|Page
5.Source Code
import java.util.*;
// Customer Class
class Customer {
private int customerID;
private String name;
private String phoneNumber;
public Customer(int customerID, String name, String phoneNumber) {
this.customerID = customerID;
this.name = name;
this.phoneNumber = phoneNumber;
}
public int getCustomerID() { return customerID; }
public String getName() { return name; }
public String getPhoneNumber() { return phoneNumber; }
}
// Order Class
class Order {
private List<String> orderItems;
private int orderAmount;
private String date;
private String timeSlot;
public Order(List<String> items, int amount, String date, String timeSlot) {
this.orderItems = items;
this.orderAmount = amount;
this.date = date;
this.timeSlot = timeSlot;
}
public int getOrderAmount() { return orderAmount; }
public String getDate() { return date; }
public String getTimeSlot() { return timeSlot; }
public List<String> getOrderItems() { return orderItems; }
}
// Table Class
class Table {
private int tableNumber;
private boolean isBooked;
public Table(int tableNumber) {
this.tableNumber = tableNumber;
this.isBooked = false;
}
public boolean bookTable() {
if (!isBooked) {
isBooked = true;
return true;
}
return false;
}
public void releaseTable() { isBooked = false; }
public boolean isBooked() { return isBooked; }
10 | P a g e
public int getTableNumber() { return tableNumber; }
}
// Restaurant System Class
class RestaurantSystem {
private List<Table> tables = new ArrayList<>();
private List<Customer> customers = new ArrayList<>();
private List<Order> orders = new ArrayList<>();
public RestaurantSystem() {
for (int i = 1; i <= 7; i++) {
tables.add(new Table(i));
}
}
public void displayMenu() {
System.out.println("\n--- Food Menu ---");
System.out.println("1. Burger - $5");
System.out.println("2. Pizza - $10");
System.out.println("3. Salad - $7\n");
}
public boolean bookTable(int tableNumber, Customer customer, List<String>
items, int amount, String date, String timeSlot) {
for (Order order : orders) {
if (order.getDate().equals(date) &&
order.getTimeSlot().equals(timeSlot)) {
System.out.println("Error: Table already booked for that slot.");
return false;
}
}
customers.add(customer);
orders.add(new Order(items, amount, date, timeSlot));
System.out.println("Table " + tableNumber + " booked successfully for " +
customer.getName() + " on " + date + " at " + timeSlot + ".");
return true;
}
public int calculateRevenue(String date) {
int total = 0;
for (Order order : orders) {
if (order.getDate().equals(date)) {
total += order.getOrderAmount();
}
}
return total;
}
public void printCustomerDetails() {
System.out.println("\n--- Customer Booking Details ---");
for (int i = 0; i < customers.size(); i++) {
Customer customer = customers.get(i);
Order order = orders.get(i);
System.out.println("Customer ID : " + customer.getCustomerID());
System.out.println("Name : " + customer.getName());
System.out.println("Phone Number : " + customer.getPhoneNumber());
System.out.println("Date : " + order.getDate());
System.out.println("Time Slot : " + order.getTimeSlot());
System.out.println("Items Ordered: " + order.getOrderItems());
System.out.println("Order Amount : $" + order.getOrderAmount());
System.out.println("-----------------------------------");
}
}
11 | P a g e
public void showOccupancy(String date, String timeSlot) {
System.out.println("\n--- Occupancy Status for " + date + " [" + timeSlot
+ "] ---");
for (int i = 1; i <= 7; i++) {
boolean booked = false;
for (Order order : orders) {
if (order.getDate().equals(date) &&
order.getTimeSlot().equals(timeSlot)) {
booked = true;
break;
}
}
System.out.println("Table " + i + ": " + (booked ? "Booked" :
"Available"));
}
}
}
// Main Class
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
RestaurantSystem system = new RestaurantSystem();
system.displayMenu();
System.out.print("Enter Customer ID: ");
int customerID = Integer.parseInt(sc.nextLine());
System.out.print("Enter Customer Name: ");
String customerName = sc.nextLine();
System.out.print("Enter Phone Number: ");
String phoneNumber = sc.nextLine();
System.out.print("Enter Booking Date (DDMMYYYY): ");
String date = sc.nextLine();
System.out.print("Enter Time Slot (e.g., 12:00–13:00): ");
String timeSlot = sc.nextLine();
System.out.print("Enter Table Number (1 to 7): ");
int tableNumber = Integer.parseInt(sc.nextLine());
System.out.print("How many food items to order? ");
int n = Integer.parseInt(sc.nextLine());
List<String> items = new ArrayList<>();
int totalAmount = 0;
for (int i = 0; i < n; i++) {
System.out.print("Enter food item (Burger/Pizza/Salad): ");
String item = sc.nextLine();
items.add(item);
// Calculate total price based on item
switch (item.toLowerCase()) {
case "burger":
totalAmount += 5;
break;
case "pizza":
totalAmount += 10;
break;
case "salad":
totalAmount += 7;
break;
12 | P a g e
default:
System.out.println("Invalid item entered, skipping.");
break;
}
}
Customer customer = new Customer(customerID, customerName, phoneNumber);
system.bookTable(tableNumber, customer, items, totalAmount, date,
timeSlot);
system.showOccupancy(date, timeSlot);
int totalRevenue = system.calculateRevenue(date);
System.out.println("\nTotal Revenue for " + date + ": $" + totalRevenue);
system.printCustomerDetails();
sc.close();
}
}
13 | P a g e
6.Outcomes
14 | P a g e
7. Conclusion and Future Work
Key Findings from the Project
The Restaurant Management System (RMS) effectively automates core
tasks such as table reservations, order management, and revenue
calculation.
o Prevents double-booking by checking table availability based on date and time
slot.
o Records customer details and food orders accurately for each booking.
o Displays menu, shows real-time table occupancy, calculates total daily
revenue, and identifies the top-spending customer.
The system is designed using Object-Oriented Programming principles:
o Encapsulation ensures data security and controlled access through methods.
o Classes model real-world entities like Customer, Table, Order, and
RestaurantSystem.
o The modular structure makes it easier to maintain and extend in the future.
Limitations of the Current Design
No persistent data storage: All data is lost once the program ends.
Command-line interface only: Limited usability for general staff or
customers.
No option for booking modification or cancellation once created.
Possible Extensions for Future Work
1. Database integration using MySQL or SQLite for persistent data storage.
15 | P a g e
2. Implementing a graphical user interface (GUI) using JavaFX or Swing for
better usability.
3. Adding online payment support to facilitate secure bill payments.
16 | P a g e
8. References
Herbert Schildt, "Java: The Complete Reference", McGraw-Hill Education,
11th Edition.
Oracle Official Java Documentation –
https://docs.oracle.com/javase/8/docs/
TutorialsPoint Java Programming Guide –
https://www.tutorialspoint.com/java/index.htm
OOP Design Principles – https://www.geeksforgeeks.org/object-oriented-
programming-oops-concept-in-java/
17 | P a g e