0% found this document useful (0 votes)
9 views

Kartik Gupta and kartik Aggarwal Computer science Project

The document presents a Computer Science project on a Restaurant Management System by Kartik Aggarwal and Kartik Gupta for the academic year 2024-25. It includes a project overview, detailing its objectives, features, and implementation using Python and MySQL, along with acknowledgments and a certificate of completion. The system aims to streamline restaurant operations by managing menu inventories, customer information, and billing processes effectively.

Uploaded by

manu pro gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Kartik Gupta and kartik Aggarwal Computer science Project

The document presents a Computer Science project on a Restaurant Management System by Kartik Aggarwal and Kartik Gupta for the academic year 2024-25. It includes a project overview, detailing its objectives, features, and implementation using Python and MySQL, along with acknowledgments and a certificate of completion. The system aims to streamline restaurant operations by managing menu inventories, customer information, and billing processes effectively.

Uploaded by

manu pro gaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Vivekanand Public School

Computer Science
Project on
RESTAURANT MANAGEMENT SYSTEM
Session: 2024-25
BY Kartik Aggarwal & Kartik Gupta

Name: Kartik Aggarwal & Kartik Gupta


Class: XII-B
Topic: RESTAURANT MANAGEMENT SYSTEM
Roll No:
Academic Year: 2024-25
CERTIFICATE
This is to certify that Kartik Aggarwal & Kartik Gupta, excellent students
of class 12th – B, have successfully completed the Computer Science project
on the topic: Restaurant Management System. This project showcases
their understanding and application of various programming concepts, as
well as their ability to implement a real-world solution.

Under the guidance of Mrs. Anshu Sharma, Kartik Aggarwal & Kartik
Gupta have demonstrated exceptional skills and dedication throughout the
academic year 2024-25. Their work reflects a thorough understanding of
the subject matter and a commitment to excellence.

We commend Kartik Aggarwal & Kartik Gupta for their hard work and
effort in completing this project.

Signature of Signature of
External Examiner: Internal Examiner:

__________________ ________________________
Acknowledgment
We would like to express our sincere thanks to everyone who played a
significant role in the completion of our computer science project on the
topic: Restaurant Management System.

Firstly, we wish to thank our computer teacher, Mrs. Anshu Sharma,


whose continuous support and guidance were instrumental in making this
project a success. Her theoretical knowledge and valuable insights helped
us grasp complex concepts, and we are grateful for her encouragement
throughout the process.

We also want to express our gratitude to our honourable principal, Mrs.


Nancy Khanna, for providing us with the opportunity to explore
technology education. We appreciate the faculty members who contributed
significantly to making the theoretical aspects understandable.

We are also indebted to our families for their unwavering support. From
providing the necessary resources and facilities to encouraging us every
step of the way, their cooperation has been invaluable. Without their
support, this project would not have been completed.

Finally, we would like to acknowledge our friends, who not only supported
us throughout this journey but also shared their insights and provided
valuable samples. Their guidance and encouragement were crucial in
refining the project at various stages.
Contents
1. Project Overview
o An introduction to the Restaurant Management System,
outlining its objectives, key features, and functionality.
2. Dependencies and Libraries Used
o A list of all the external libraries and dependencies utilized in
the project, including details about their purpose and
installation.
3. Database Structure
o A detailed explanation of the tables created in the MySQL
database, including the schema for the Restaurant records,
Customers, and Employees tables.
4. Implementation in Python
o An overview of the core Python code, explaining how the
system operates, the logic behind key functions, and user
interaction processes.
5. Project Outputs and Results
o A summary of the results produced by the system, including
sample outputs, screenshots, and the overall performance of
the application.
6. References
o A section dedicated to acknowledging the support received during
the project, along with references to any resources or
documentation used in the development process.
Project Overview
The Restaurant Management System project is designed to efficiently manage
various aspects of restaurant operations, focusing on enhancing the overall customer
experience. This system utilizes a MySQL database to keep track of essential
information related to menu management, customer details, order records, and
billing processes.

Key Features:

 Database Structure:
o Restaurant records Table: This table stores information about customer
orders, including order number, quantities for various menu items (such as
pizzas, burgers, ice creams, and drinks), cost details, and tax calculations.
o Customers Table: This table keeps records of customer details such as
customer ID, name, contact information, and address, ensuring easy access
and management of customer data.
o Employees Table: this table records employee information, including
employee ID, name, position, contact information, and address, facilitating
efficient staff management.
 Administrator Capabilities:
o Menu Management: Administrators can create new menu item records,
update existing item details, view all menu items, and manage stock levels.
o Customer Management: Administrators can add new customer details,
view all customers, and maintain customer records, enhancing customer
relationship management.
o Order Management: Administrators can process orders, view all order
records, generate invoices, and maintain organized billing records.
o Reporting: The system provides functionality to display lists of all menu
items, current stock levels, customer details, order records, and billing
summaries.

Purpose:
The purpose of this project is to streamline restaurant operations, making it easier to
manage menu inventories, order transactions, customer information, and billing processes.
It aims to provide a user-friendly interface for administrators to efficiently handle day-to-
day tasks, ensuring smooth operation and management of restaurant resources.

This project offers a comprehensive solution for restaurant management, improving


operational efficiency and enhancing the customer experience by maintaining accurate and
up-to-date records. The bill generation feature further enhances transparency and
facilitates better tracking of sales activities, ensuring that all transactions are systematically
recorded.
Dependencies and Libraries Used
1. MySQL Connector:
o The MySQL. Connector: library is a crucial component of this project,
providing the necessary tools for establishing a connection to a MySQL
database. This library facilitates the execution of SQL queries, data
manipulation, and interaction with the database system. By importing this
library, the application can efficiently handle all database-related tasks,
ensuring smooth communication between the Python code and the MySQL
server.

FUNCTIONS USED IN PROJECT

1. connect():
o This function is integral to the project as it establishes a secure connection to
the MySQL database. It initializes the connection parameters such as the
host, user credentials, password, and database name. Additionally, it checks
for any existing tables in the database, creating them if they do not exist. This
function serves as the foundation for all database operations within the
system, ensuring that the application can interact with the database
effectively.
2. cursor():
o The cursor() function creates a cursor object, which acts as a pointer that
allows the application to execute SQL queries and retrieve results. This object
is essential for managing the context of the SQL commands, as it keeps track
of the current position within the result set. By utilizing the cursor, the
application can perform a variety of operations, including executing SELECT,
INSERT, UPDATE, and DELETE statements.
3. fetchall():
o This function retrieves all rows from the result set generated by a SELECT
query. It returns the results as a list of tuples, where each tuple represents a
row of data. This capability is particularly useful when displaying large
datasets or when the application needs to process multiple records at once. The
fetchall() function simplifies data handling, allowing for easy iteration and
manipulation of the retrieved information.
4. commit():
o The commit() function is responsible for finalizing changes made during the
current transaction. After executing any operation that modifies the database,
such as inserting or updating records, this function must be called to ensure
that those changes are saved permanently. Without calling commit(), any
modifications would be lost once the database connection is closed, making
this function vital for data integrity and consistency.
5. fetchone():
o This function is utilized to retrieve a single row from the result set returned by
a query. It is particularly useful when the application needs to fetch a unique
record or when only one entry is expected as a result.
Database Structure

Database: restaurant_management_system_by_kartik_gupta

TABLE: CUSTOMERS

TABLE: EMPLOYEES
TABLE: RESTAURANTRECORDS
Implementation in Python
Python Source code:

import mysql.connector as mycon

# Function to connect to MySQL and set up the database and tables

def Database():

global connectn, cursor

try:

# Connect to MySQL without specifying a database

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906"

cursor = connectn.cursor()

print("Connected to MySQL server successfully.")

# Create the database if it does not exist

cursor.execute("CREATE DATABASE IF NOT EXISTS


Restaurant_Management_System_By_Kartik_Gupta")

print("Database creation command executed.")

# Connect to the newly created database

connectn.database = "Restaurant_Management_System_By_Kartik_Gupta"

# Create tables if they do not exist

cursor.execute("""

CREATE TABLE IF NOT EXISTS Restaurantrecords (


ordno VARCHAR(10), piz INT, bur INT, ice INT, dr INT,

ct FLOAT, sb FLOAT, tax FLOAT, sr FLOAT, tot FLOAT)

""")

cursor.execute("""

CREATE TABLE IF NOT EXISTS Customers (

cust_id INT PRIMARY KEY AUTO_INCREMENT,

cust_name VARCHAR(100),

contact VARCHAR(15),

address VARCHAR(255))

""")

cursor.execute("""

CREATE TABLE IF NOT EXISTS Employees (

emp_id INT PRIMARY KEY AUTO_INCREMENT,

emp_name VARCHAR(100),

position VARCHAR(50),

contact VARCHAR(15),

address VARCHAR(255))

""")

print("Database and tables created successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()
# Function to calculate total cost

def calculate_total(pizza_qty, burger_qty, icecream_qty, drinks_qty):

try:

cost_pizza = pizza_qty * 240

cost_burger = burger_qty * 125

cost_icecream = icecream_qty * 80

cost_drinks = drinks_qty * 60

cost_of_meal = cost_pizza + cost_burger + cost_icecream + cost_drinks

tax = cost_of_meal * 0.18

service_charge = cost_of_meal / 99

total_cost = cost_of_meal + tax + service_charge

return cost_of_meal, tax, service_charge, total_cost

except ValueError:

print("Invalid input values. Please enter valid quantities.")

return None

# Function to add order record

def add_order(orderno, pizza_qty, burger_qty, icecream_qty, drinks_qty):

Database()

costs = calculate_total(pizza_qty, burger_qty, icecream_qty, drinks_qty)

if costs:

cost_of_meal, tax, service_charge, total_cost = costs

try:

connectn = mycon.connect(

host="localhost",
user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

INSERT INTO Restaurantrecords (ordno, piz, bur, ice, dr, ct, sb, tax, sr, tot)

VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)

""", (orderno, pizza_qty, burger_qty, icecream_qty, drinks_qty, cost_of_meal,


cost_of_meal, tax, service_charge, total_cost))

connectn.commit()

print("Order added successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to display all orders

def display_orders():

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("SELECT * FROM Restaurantrecords")

orders = cursor.fetchall()

for order in orders:

print(order)

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to delete an order

def delete_order(orderno):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()
cursor.execute("DELETE FROM Restaurantrecords WHERE ordno = %s", (orderno,))

connectn.commit()

print(f"Order {orderno} deleted successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to update an order

def update_order(orderno, pizza_qty, burger_qty, icecream_qty, drinks_qty):

Database()

costs = calculate_total(pizza_qty, burger_qty, icecream_qty, drinks_qty)

if costs:

cost_of_meal, tax, service_charge, total_cost = costs

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

UPDATE Restaurantrecords
SET piz = %s, bur = %s, ice = %s, dr = %s, ct = %s, sb = %s, tax = %s, sr = %s, tot = %s

WHERE ordno = %s

""", (pizza_qty, burger_qty, icecream_qty, drinks_qty, cost_of_meal, cost_of_meal,


tax, service_charge, total_cost, orderno))

connectn.commit()

print("Order updated successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to add a customer

def add_customer(name, contact, address):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

INSERT INTO Customers (cust_name, contact, address)


VALUES (%s, %s, %s)

""", (name, contact, address))

connectn.commit()

print("Customer added successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to display all customers

def display_customers():

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("SELECT * FROM Customers")

customers = cursor.fetchall()

for customer in customers:


print(customer)

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to delete a customer

def delete_customer(cust_id):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("DELETE FROM Customers WHERE cust_id = %s", (cust_id,))

connectn.commit()

print(f"Customer {cust_id} deleted successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:
cursor.close()

connectn.close()

# Function to update a customer

def update_customer(cust_id, name, contact, address):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

UPDATE Customers

SET cust_name = %s, contact = %s, address = %s

WHERE cust_id = %s

""", (name, contact, address, cust_id))

connectn.commit()

print("Customer updated successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:
cursor.close()

connectn.close()

# Function to add an employee

def add_employee(name, position, contact, address):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

INSERT INTO Employees (emp_name, position, contact, address)

VALUES (%s, %s, %s, %s)

""", (name, position, contact, address))

connectn.commit()

print("Employee added successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()
connectn.close()

# Function to display all employees

def display_employees():

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("SELECT * FROM Employees")

employees = cursor.fetchall()

for employee in employees:

print(employee)

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to delete an employee


def delete_employee(emp_id):

Database()

try:

connectn = mycon.connect(

host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("DELETE FROM Employees WHERE emp_id = %s", (emp_id,))

connectn.commit()

print(f"Employee {emp_id} deleted successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to update an employee

def update_employee(emp_id, name, position, contact, address):

Database()

try:

connectn = mycon.connect(
host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("""

UPDATE Employees

SET emp_name = %s, position = %s, contact = %s, address = %s

WHERE emp_id = %s

""", (name, position, contact, address, emp_id))

connectn.commit()

print("Employee updated successfully!")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Function to generate a bill for a specific order

def generate_bill(orderno):

Database()

try:

connectn = mycon.connect(
host="localhost",

user="root",

password="aksh9906",

database="Restaurant_Management_System_By_Kartik_Gupta"

cursor = connectn.cursor()

cursor.execute("SELECT * FROM Restaurantrecords WHERE ordno = %s", (orderno,))

order = cursor.fetchone()

if order:

print("\n--- Bill Details ---")

print(f"Order No: {order[0]}")

print(f"Pizza Qty: {order[1]}, Burger Qty: {order[2]}, Ice Cream Qty: {order[3]}, Drinks
Qty: {order[4]}")

print(f"Cost: {order[5]}, Subtotal: {order[6]}, Tax: {order[7]}, Service Charge:


{order[8]}")

print(f"Total: {order[9]}")

else:

print(f"Order {orderno} not found.")

except mycon.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

connectn.close()

# Main menu for interacting with the system


def main_menu():

while True:

print("#" * 70)

print("- Welcome to Restaurant Management System By Kartik Gupta Kartik Aggarwal ")

print("#" * 70)

print("1. Add Order")

print("2. Display Orders")

print("3. Delete Order")

print("4. Update Order")

print("5. Add Customer")

print("6. Display Customers")

print("7. Delete Customer")

print("8. Update Customer")

print("9. Add Employee")

print("10. Display Employees")

print("11. Delete Employee")

print("12. Update Employee")

print("13. Generate Bill")

print("14. Exit")

choice = input("Enter your choice: ")

if choice == '1':

orderno = input("Enter Order Number: ")


pizza_qty = int(input("Enter Pizza Quantity: "))

burger_qty = int(input("Enter Burger Quantity: "))

icecream_qty = int(input("Enter Icecream Quantity: "))

drinks_qty = int(input("Enter Drinks Quantity: "))

add_order(orderno, pizza_qty, burger_qty, icecream_qty, drinks_qty)

elif choice == '2':

display_orders()

elif choice == '3':

orderno = input("Enter Order Number to delete: ")

delete_order(orderno)

elif choice == '4':

orderno = input("Enter Order Number to update: ")

pizza_qty = int(input("Enter Pizza Quantity: "))

burger_qty = int(input("Enter Burger Quantity: "))

icecream_qty = int(input("Enter Icecream Quantity: "))

drinks_qty = int(input("Enter Drinks Quantity: "))

update_order(orderno, pizza_qty, burger_qty, icecream_qty, drinks_qty)

elif choice == '5':

name = input("Enter Customer Name: ")

contact = input("Enter Customer Contact: ")

address = input("Enter Customer Address: ")

add_customer(name, contact, address)

elif choice == '6':

display_customers()
elif choice == '7':

cust_id = input("Enter Customer ID to delete: ")

delete_customer(cust_id)

elif choice == '8':

cust_id = input("Enter Customer ID to update: ")

name = input("Enter Customer Name: ")

contact = input("Enter Customer Contact: ")

address = input("Enter Customer Address: ")

update_customer(cust_id, name, contact, address)

elif choice == '9':

name = input("Enter Employee Name: ")

position = input("Enter Employee Position: ")

contact = input("Enter Employee Contact: ")

address = input("Enter Employee Address: ")

add_employee(name, position, contact, address)

elif choice == '10':

display_employees()

elif choice == '11':

emp_id = input("Enter Employee ID to delete: ")

delete_employee(emp_id)

elif choice == '12':

emp_id = input("Enter Employee ID to update: ")

name = input("Enter Employee Name: ")

position = input("Enter Employee Position: ")


contact = input("Enter Employee Contact: ")

address = input("Enter Employee Address: ")

update_employee(emp_id, name, position, contact, address)

elif choice == '13':

orderno = input("Enter Order Number to generate bill: ")

generate_bill(orderno)

elif choice == '14':

print("Exiting the system.")

break

else:

print("Invalid choice. Please try again.")

# Create the database and tables

Database()

# Running the main menu

main_menu()
Project Outputs and Results
Python Outputs:

MAIN SCREEN:
Adding an order:
Showing all Orders:
Deleting an order:
Updating an order:
Adding a Customer:
Showing All Customers:
Deleting a Customer:
Updating Customer details:
Adding an Employee:
Showing all Employees:
Deleting an Employee
Updating Employee details:
Generating the Bill:
Exiting the Program:
MySQL:

DATA GENERATED TABLE IN THE TABLE: Customer

DATA GENERATED TABLE IN THE TABLE: restaurant records

DATA GENERATED TABLE IN THE TABLE: Employees


References
Sources:

1. Python Software Foundation. Python Documentation. Available at: www.python.org


2. Learn Python Interactive Tutorial. Available at: LearnPython.org
3. Tutorials Point. Python Tutorials. Available at: tutorialspoint.com

Software:

1. Oracle Corporation. MySQL. Available at: https://www.mysql.com


2. Python Software Foundation. Python IDLE. Available at:
https://www.python.org/downloads

Books:

1. Preeti Arora. Computer Science with Python for Class 11th & 12th. Sultan Chand &
Sons.
2. All In One Class 12th Computer Science with Python
3. Progress In Computer Science With Python Textbook & Practical Book For Class 11th
& 12th - by Sumitra Arora

You might also like