0% found this document useful (0 votes)
88 views37 pages

Hotel Management System Project Overview

The document outlines a project titled 'Hotel Management' completed by Anish Juyal as part of the Computer Science curriculum for Class XII at St. Mary's School. It describes the system's functionalities, including customer, room, billing, and cafeteria management, developed using Python and MySQL. The project also includes acknowledgments, a certificate of completion, and details about the coding process and database setup.

Uploaded by

anishjuyal6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views37 pages

Hotel Management System Project Overview

The document outlines a project titled 'Hotel Management' completed by Anish Juyal as part of the Computer Science curriculum for Class XII at St. Mary's School. It describes the system's functionalities, including customer, room, billing, and cafeteria management, developed using Python and MySQL. The project also includes acknowledgments, a certificate of completion, and details about the coding process and database setup.

Uploaded by

anishjuyal6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PROJECT FILE

HOTEL MANAGEMENT

AISSCE - All India Senior School Certificate Examination


2024-2025: SCIENCE – XII

In
COMPUTER SCIENCE (083)

Anish Juyal
XII-D
Roll. No.-________

1
CERTIFICATE

This is to certify that the project titled


“HOTEL MANAGEMENT”
has been successfully completed by:
[ANISH JUYAL]
Class: [XII-D]
Roll Number: [____________]
under my guidance and supervision. The project work is
submitted as part of the fulfillment of the Computer Science
curriculum for Class 12 as prescribed by the AISSCE.
The project embodies the student’s diligent efforts,
originality, and understanding of the subject.
Teacher’s Signature:

Name: Ms. Nisha Batra


Designation: Computer Science Teacher
Date: Submission Date

2
Acknowledgements

We would like to thank Ms. Sheelu Mathew, Principal

ST. MARY’S SCHOOL.


We are deeply indebted to our mentor Ms. Nisha Batra.

Our heartfelt thanks to CBSE.


We also express our deepest gratitude to our parents.
Finally, we would like to wind up by paying our heartfelt thanks to
all our near and dear ones.

Anish Juyal – XII D – ROLL NO:


_______

3
Contents
Introduction of the Project

We, the students of CLASS XII-D of ST. MARY’S SCHOOL, DWARKA


have been assigned the work of “HOTEL MANAGEMENT ”.

To perform this task the students were divided into the group of two
students named as Anish Juyal, Ayush Malik.

Overview
The Hotel Management System is a comprehensive tool for managing the
operations of a hotel, including customer management, room management,
billing, and cafeteria services. The system is built using Python and MySQL,
providing a robust backend for handling data securely and efficiently.
Features
1. Customer Management
 View all customers.
 Add new customers.
 Update customer details.
 Delete customer records.
2. Room Management
 View available rooms and details.
 Add new rooms to the inventory.
 Update room information.
 Delete room records.
3. Billing and Payment Management
 Generate bills for customers based on room bookings.
 View all past bills.
4. Cafeteria Management
 View the food menu.
 Place orders for customers, including multiple items.

We are so glad that this work have been assigned to us, yet we haven’t done
this work before Ms. Nisha Batra, our subject teacher has also helped us
a lot to complete this project. We feel so blessed that we have learnt all this
work with the help of our teacher, we are also thankful to our respected
principal Ms. Sheelu Mathew for providing us various facilities to
complete this project.

4
PROCESS

FIRSTLY, we have done the planning in paperwork regarding what we have


to do on the assigned project “HOTEL MANAGEMENT”.

SECONDLY, we discussed our planning with our subject teacher and then
she provided us the right path to perform the work.

NEXT, we started our project on the footpaths of our subject teacher.

THEN, we started our coding, coding took around 2 and half months for
completion.

NEXT, we analyzed the mistakes done and then we corrected them.

5
PYTHON CODING
import mysql.connector
# Function to connect to MySQL database with user-provided credentials
def connect_db():
while True:
print("\n🏨 Welcome to the Hotel Management System!")
print("Please provide your MySQL connection details.")
user = input("Enter MySQL username: ")
password = input("Enter MySQL password: ")

try:
db = mysql.connector.connect(
host="localhost",
user=user,
password=password
)
print("\n✅ Connected successfully to MySQL server!")
return db, user, password
except mysql.connector.Error as err:
print(f"Error: {err}")
print("❌ Please check your credentials and try again.\n")

# Function to connect to the HotelManagement database


def connect_db_instance(user, password):
try:
return mysql.connector.connect(
host="localhost",
user=user,
password=password,
database="HotelManagement"
)
except mysql.connector.Error as err:
print(f"Error connecting to HotelManagement database: {err}")
return None

# Database and table setup


def setup_database(user, password):

6
try:
db = mysql.connector.connect(
host="localhost",
user=user,
password=password
)
cursor = db.cursor()

# Create database
cursor.execute("CREATE DATABASE IF NOT EXISTS HotelManagement")
print("Setting up the database...")

# Use the database


cursor.execute("USE HotelManagement")

# Create tables
cursor.execute("""
CREATE TABLE IF NOT EXISTS Customers (
CustomerID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100),
Phone VARCHAR(15),
Email VARCHAR(100),
Address TEXT
)
""")
print("Created 'Customers' table.")

cursor.execute("""
CREATE TABLE IF NOT EXISTS Rooms (
RoomID INT AUTO_INCREMENT PRIMARY KEY,
RoomType VARCHAR(50),
PricePerNight FLOAT,
Availability BOOLEAN DEFAULT TRUE
)
""")
print("Created 'Rooms' table.")

cursor.execute("""
CREATE TABLE IF NOT EXISTS Bills (
7
BillID INT AUTO_INCREMENT PRIMARY KEY,
CustomerID INT,
TotalAmount FLOAT,
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
)
""")
print("Created 'Bills' table.")

cursor.execute("""
CREATE TABLE IF NOT EXISTS FoodMenu (
ItemID INT AUTO_INCREMENT PRIMARY KEY,
ItemName VARCHAR(100),
Price FLOAT
)
""")
print("Created 'FoodMenu' table.")

cursor.execute("""
CREATE TABLE IF NOT EXISTS FoodOrders (
OrderID INT AUTO_INCREMENT PRIMARY KEY,
CustomerID INT,
TotalAmount FLOAT,
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
)
""")
print("Created 'FoodOrders' table.")

print("\nDatabase setup complete. Your system is ready to use!")

# Insert default food menu items


cursor.execute("SELECT COUNT(*) FROM FoodMenu")
if cursor.fetchone()[0] == 0:
default_menu = [
("Pasta", 200),
("Pizza", 400),
("Burger", 150),
("Fries", 100),
("Coke", 50)
]
8
cursor.executemany("INSERT INTO FoodMenu (ItemName, Price)
VALUES (%s, %s)", default_menu)
db.commit()
print("Default food menu added.")

except mysql.connector.Error as err:


print(f"Error during setup: {err}")
finally:
cursor.close()
db.close()

# Customer Management
def customer_menu(user, password):
while True:
print("\n👤 Customer Management Menu")
print("1. View All Customers")
print("2. Add New Customer")
print("3. Update Customer Details")
print("4. Delete Customer")
print("5. Back to Main Menu")
choice = input("Please choose an option: ")

if choice == '1':
view_customers(user, password)
elif choice == '2':
add_customer(user, password)
elif choice == '3':
update_customer(user, password)
elif choice == '4':
delete_customer(user, password)
elif choice == '5':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please try again.")

def view_customers(user, password):


db = connect_db_instance(user, password)
if db is None:
9
return
cursor = db.cursor()
cursor.execute("SELECT * FROM Customers")
results = cursor.fetchall()
print("\n📋 Customer List:")
print("CustomerID | Name | Phone | Email | Address")
for row in results:
print(f"{row[0]} | {row[1]} | {row[2]} | {row[3]} | {row[4]}")
db.close()

def add_customer(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
name = input("Enter Customer Name: ")
phone = input("Enter Phone Number: ")
email = input("Enter Email: ")
address = input("Enter Address: ")
cursor.execute("INSERT INTO Customers (Name, Phone, Email, Address)
VALUES (%s, %s, %s, %s)",
(name, phone, email, address))
db.commit()
print("✔️Customer added successfully!")
db.close()

def update_customer(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
customer_id = int(input("Enter Customer ID to update: "))
print("1. Update Name")
print("2. Update Phone")
print("3. Update Email")
print("4. Update Address")
choice = input("Choose a field to update: ")

if choice == '1':
10
new_name = input("Enter new Name: ")
cursor.execute("UPDATE Customers SET Name = %s WHERE CustomerID =
%s", (new_name, customer_id))
elif choice == '2':
new_phone = input("Enter new Phone: ")
cursor.execute("UPDATE Customers SET Phone = %s WHERE CustomerID =
%s", (new_phone, customer_id))
elif choice == '3':
new_email = input("Enter new Email: ")
cursor.execute("UPDATE Customers SET Email = %s WHERE CustomerID =
%s", (new_email, customer_id))
elif choice == '4':
new_address = input("Enter new Address: ")
cursor.execute("UPDATE Customers SET Address = %s WHERE CustomerID
= %s", (new_address, customer_id))
else:
print("Invalid choice. Returning to Customer Management Menu.")
db.close()
return

db.commit()
print("✔️Customer details updated successfully!")
db.close()

def delete_customer(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
customer_id = int(input("Enter Customer ID to delete: "))
cursor.execute("DELETE FROM Customers WHERE CustomerID = %s",
(customer_id,))
db.commit()
print("✔️Customer deleted successfully!")
db.close()

# Room Management
def room_menu(user, password):
while True:
11
print("\n🏨 Room Management Menu")
print("1. View All Rooms")
print("2. Add New Room")
print("3. Update Room Details")
print("4. Delete Room")
print("5. Back to Main Menu")
choice = input("Please choose an option: ")

if choice == '1':
view_rooms(user, password)
elif choice == '2':
add_room(user, password)
elif choice == '3':
update_room(user, password)
elif choice == '4':
delete_room(user, password)
elif choice == '5':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please try again.")

def view_rooms(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
cursor.execute("SELECT * FROM Rooms")
results = cursor.fetchall()
print("\n📋 Room List:")
print("RoomID | Room Type | Price Per Night | Availability")
for row in results:
availability = "Available" if row[3] else "Booked"
print(f"{row[0]} | {row[1]} | {row[2]} | {availability}")
db.close()

def add_room(user, password):


db = connect_db_instance(user, password)
if db is None:
12
return
cursor = db.cursor()
room_type = input("Enter Room Type: ")
price = float(input("Enter Price Per Night: "))
cursor.execute("INSERT INTO Rooms (RoomType, PricePerNight) VALUES
(%s, %s)", (room_type, price))
db.commit()
print("✔️Room added successfully!")
db.close()

def update_room(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
room_id = int(input("Enter Room ID to update: "))
print("1. Update Room Type")
print("2. Update Price Per Night")
choice = input("Choose a field to update: ")

if choice == '1':
new_type = input("Enter new Room Type: ")
cursor.execute("UPDATE Rooms SET RoomType = %s WHERE RoomID =
%s", (new_type, room_id))
elif choice == '2':
new_price = float(input("Enter new Price Per Night: "))
cursor.execute("UPDATE Rooms SET PricePerNight = %s WHERE RoomID =
%s", (new_price, room_id))
else:
print("Invalid choice. Returning to Room Management Menu.")
db.close()
return

db.commit()
print("✔️Room details updated successfully!")
db.close()

def delete_room(user, password):


db = connect_db_instance(user, password)
13
if db is None:
return
cursor = db.cursor()
room_id = int(input("Enter Room ID to delete: "))
cursor.execute("DELETE FROM Rooms WHERE RoomID = %s", (room_id,))
db.commit()
print("✔️Room deleted successfully!")
db.close()

# Billing Menu
def billing_menu(user, password):
while True:
print("\n💳 Billing and Payment Menu")
print("1. Generate Bill")
print("2. View All Bills")
print("3. Back to Main Menu")
choice = input("Please choose an option: ")

if choice == '1':
generate_bill(user, password)
elif choice == '2':
view_bills(user, password)
elif choice == '3':
print("Returning to the Main Menu...")
break
else:
print("Invalid choice. Please try again.")

def generate_bill(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
customer_id = int(input("Enter Customer ID: "))

try:
# Retrieve bill details
cursor.execute("SELECT TotalAmount FROM Bills WHERE CustomerID =
%s", (customer_id,))
14
bill_info = cursor.fetchone()
if not bill_info:
print("❌ No bill found for this customer.")
return

total_amount = bill_info[0]

# Retrieve customer details


cursor.execute("SELECT Name FROM Customers WHERE CustomerID =
%s", (customer_id,))
customer_name = cursor.fetchone()[0]

# Display bill details


print("\n💳 Customer Bill")
print(f"Customer Name: {customer_name}")
print(f"Total Amount: {total_amount:.2f}")

except mysql.connector.Error as err:


print(f"Error: {err}")
finally:
db.close()

def view_bills(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
print("\n📋 List of All Bills:")
cursor.execute("SELECT * FROM Bills")
results = cursor.fetchall()
for row in results:
print(row)
db.close()

# Cafeteria Menu
def cafeteria_menu(user, password):
while True:
print("\n🍴 Cafeteria Menu")
15
print("1. View Food Menu")
print("2. Place an Order")
print("3. Back to Main Menu")
choice = input("Please choose an option: ")

if choice == '1':
view_food_menu(user, password)
elif choice == '2':
place_order(user, password)
elif choice == '3':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please try again.")

def view_food_menu(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
cursor.execute("SELECT * FROM FoodMenu")
results = cursor.fetchall()
print("\n📋 Food Menu:")
print("ItemID | Item Name | Price")
for row in results:
print(f"{row[0]} | {row[1]} | {row[2]}")
db.close()

def place_order(user, password):


db = connect_db_instance(user, password)
if db is None:
return
cursor = db.cursor()
customer_id = int(input("Enter Customer ID: "))
view_food_menu(user, password)
total = 0

while True:
item_id = int(input("Enter Item ID to add to order (or 0 to finish): "))
16
if item_id == 0:
break
cursor.execute("SELECT Price FROM FoodMenu WHERE ItemID = %s",
(item_id,))
price = cursor.fetchone()
if price:
total += price[0]
else:
print("Invalid Item ID.")

cursor.execute("INSERT INTO FoodOrders (CustomerID, TotalAmount)


VALUES (%s, %s)", (customer_id, total))
db.commit()
print(f"✔️Order placed successfully! Total Amount: {total}")
db.close()

# Main Menu
def main_menu(user, password):
while True:
print("\n🏨 Welcome to the Hotel Management System 🏨")
print("1. Customer Management")
print("2. Room Management")
print("3. Billing")
print("4. Cafeteria")
print("5. Exit")
choice = input("Please choose an option: ")

if choice == '1':
customer_menu(user, password)
elif choice == '2':
room_menu(user, password)
elif choice == '3':
billing_menu(user,password)
elif choice == '4':
cafeteria_menu(user, password)
elif choice == '5':
print("Thank you for using the Hotel Management System. Goodbye!")
break
else:
17
print("Invalid choice. Please try again.")

# Main execution starts here


if __name__ == "__main__":
db, user, password = connect_db()
setup_database(user, password)
main_menu(user, password)

# END OF THE PROJECT

18
Output of the Project
Finally, we conclude our work and present the output of the Project.

STARTING OF SOFTWARE

1. CUSTOMER MANAGEMENT MENU

19
1.1) TO VIEW ALL CUSTOMERS

1.2) TO ADD A NEW CUSTOMER

20
1.3)TO UPDATE AN EXISTING CUSTOMER

1.4) TO DELETE A CUSTOMER

21
2.ROOM MANAGEMENT

22
2.1) TO VIEW ALL EXISTING ROOMS

2.2) TO ADD A NEW ROOM

2.3) TO UPDATE AN EXISTING ROOM DETAILS

23
2.4) TO DELETE AN EXISTING ROOM

3.BILLING

24
3.1) TO GENERATE A NEW BILL

3.2) TO VIEW ALL BILLS

25
4. CAFETERIA

4.1) TO VIEW FOOD MENU


26
27
4.2) TO PLACE AN ORDER

5. TO EXIT THE MAIN MENU

28
TABLES IN DATABASE – HOTEL MANAGEMENT

TABLE STRUCTURE - BILLS

TABLE STRUCTURE – CUSTOMERS


29
TABLE STRUCTURE – FOODMENU

TABLE STRUCTURE – FOODORDERS

30
TABLE STRUCTURE – ROOMS

DATA GENERATED IN THE TABLE – BILLS

DATA GENERATED IN THE TABLE – CUSTOMERS

31
DATA GENERATED IN THE TABLE – FOODMENU

DATA GENERATED IN THE TABLE – FOODORDERS

32
DATA GENERATED IN THE TABLE – ROOMS

33
ANALYSIS
Advantages
 Efficiency: Streamlines hotel operations by integrating
all functionalities into one system.
 Data Organization: Maintains comprehensive records
of customers, rooms, and transactions.
 Customizable: Easily extendable to include additional
features like online booking or loyalty programs.
 Cost-effective: Built with open-source tools, reducing
implementation costs.
Disadvantages
 User Interface: The current text-based interface can be
cumbersome for non-technical users.
 Scalability: May require significant changes to handle
very large datasets or multi-location operations.
 Dependency on MySQL: Relies heavily on MySQL,
which might not be preferred by all organizations.
 Limited Security Features: Role-based access control
and advanced authentication mechanisms are not
implemented.

Scope of Improvement
1. User Experience Enhancements
 Input Validation: Implement stricter input validation

to prevent errors such as invalid IDs or incorrect data


formats.

34
 Interactive Menus: Replace text-based menus with a
graphical user interface (GUI) for better usability.
 Error Messages: Make error messages more

descriptive and user-friendly.


2. Database Improvements
 Data Consistency Checks: Ensure referential integrity

in all operations, especially when deleting records


linked to other tables.
 Search and Filter Options: Allow users to search and

filter records in customer, room, and billing data.


3. System Features
 Advanced Reporting: Add reporting capabilities to

generate insights like occupancy rates, total revenue,


and customer preferences.
 User Roles: Implement role-based access control to

differentiate between admin and staff functionalities.


 Online Booking: Add a module for online room

booking and payment.


 Bill Generation: Can add a way to create a new bill for

an existing customer.
4. Performance Optimization
 Optimize database queries to improve the response

time for large datasets.

Challenges Addressed
 Database Connectivity: Resolved issues with initial
database setup and ensured smooth interaction with
MySQL.
 Error Handling: Fixed critical bugs such as the
35
TypeError in the billing module by validating data
before processing.
 Default Data: Added default data for the cafeteria
menu to streamline the setup process.

36
Conclusion
The Hotel Management System is a robust
foundation for managing hotel operations. It
provides a structured way to handle customer,
room, billing, and cafeteria functionalities
efficiently. While the current system addresses
the fundamental requirements of hotel
management, there is significant potential for
enhancement. Introducing a graphical user
interface, advanced analytics, and security
improvements will elevate the system's usability
and scalability, making it a preferred choice for
diverse hotel businesses. By continuing to evolve
and integrate new features, the system can be
adapted to meet the dynamic needs of the
hospitality industry.

37

You might also like