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

Computer Science Project

Uploaded by

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

Computer Science Project

Uploaded by

rronline0005
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

COMPUTER SCIENCE PROJECT

HOTEL MANAGEMENT

A Project Report

Submitted by

Shinjini Koshti

12 A

Roll No. - 12130

At

Kendriya Vidyalaya 1 STC

Jabalpur, MP
CERTIFICATE

This is to certify that this project work is


submitted by SHINJINI KOSHTI of class
12th to the computer science
department of Kendriya Vidyalaya 1
STC. It is further certified that work is
original and is of standard to warrant
presentation for CBSE Board of
examination.

Mrs. Sushila Tekam


Computer Science
ACKNOWLEDGEMENT

It would be my pleasure to express my


heart filled gratitude to my chemistry
teacher Mrs. Sushila Tekam for
providing a helping hand in making
this project and instilling in me the
desire to work. Her valuable guidance,
support and supervision throughout
this project is responsible for this topic
to become a successful project.

Shinjini Koshti
12th A
CONTENTS

1.Introduction
2. Key Features
3. Python Codes
4. Output
5. MYSQL tables
6. Bibliography
INTRODUCTION

A Hotel Management System (HMS) is an


essential tool for managing various
operations and services within a hotel. It
helps automate the day-to-day activities
such as room bookings, check-ins,
check-outs, customer billing, and managing
room availability. In today's digital world,
such systems are invaluable for improving
efficiency, minimising errors, and enhancing
the overall customer experience. The
primary goal of an HMS is to streamline
operations and provide seamless
management of guest services.
Key Features of the Hotel Management System:

1. Guest Management
It involves handling guest reservations, check-ins, check-outs,
and billing for smooth operations and improved guest
experience.

2.Room management
It involves organising and maintaining a space to ensure it is
functional, comfortable, and conducive to its intended purpose.

3. Reservation management
Process of organising and tracking bookings to ensure smooth
scheduling and customer communication.

4. Billing and invoicing


It involves creating and managing invoices, processing
payments, and tracking financial transactions.

5. Feedback
Leave reviews and ratings after their stay, which the hotel can
use to improve its services and address customer concerns

6. Inventory Management System


helps track items in the hotel, such as room supplies, linens,
food & beverages, and cleaning products.
PYTHON CODES
1. Setting Up the SQLite Database

import sqlite3

def create_db():
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()

# Create the necessary tables


cursor.execute('''
CREATE TABLE IF NOT EXISTS Guests (
guest_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
contact TEXT,
email TEXT,
address TEXT
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Rooms (
room_id INTEGER PRIMARY KEY AUTOINCREMENT,
room_number INTEGER UNIQUE,
room_type TEXT,
price REAL,
status TEXT -- 'Available', 'Occupied', 'Under Maintenance'
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Reservations (
reservation_id INTEGER PRIMARY KEY AUTOINCREMENT,
guest_id INTEGER,
room_id INTEGER,
check_in_date TEXT,
check_out_date TEXT,
status TEXT, -- 'Confirmed', 'Checked-In', 'Checked-Out'
FOREIGN KEY (guest_id) REFERENCES Guests (guest_id),
FOREIGN KEY (room_id) REFERENCES Rooms (room_id)
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Billing (
bill_id INTEGER PRIMARY KEY AUTOINCREMENT,
reservation_id INTEGER,
amount REAL,
payment_status TEXT, -- 'Paid', 'Pending'
FOREIGN KEY (reservation_id) REFERENCES Reservations
(reservation_id)
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Inventory (
item_id INTEGER PRIMARY KEY AUTOINCREMENT,
item_name TEXT,
quantity INTEGER,
price REAL
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Housekeeping (
room_id INTEGER,
status TEXT, -- 'Clean', 'Dirty', 'Under Maintenance'
FOREIGN KEY (room_id) REFERENCES Rooms (room_id)
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Reports (
report_id INTEGER PRIMARY KEY AUTOINCREMENT,
report_type TEXT,
report_date TEXT,
content TEXT
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Feedback (
feedback_id INTEGER PRIMARY KEY AUTOINCREMENT,
guest_id INTEGER,
feedback_text TEXT,
FOREIGN KEY (guest_id) REFERENCES Guests (guest_id)
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Users (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT,
password TEXT,
role TEXT -- 'Admin', 'Front Desk', 'Housekeeping', 'Manager'
)''')

cursor.execute('''
CREATE TABLE IF NOT EXISTS Menu (
menu_id INTEGER PRIMARY KEY AUTOINCREMENT,
item_name TEXT,
price REAL
)''')

conn.commit()
conn.close()

2. Guest Management

Output:
class Guest:
def __init__(self, name, contact, email, address):
self.name = name
self.contact = contact
self.email = email
self.address = address

def add_guest(self):
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()
cursor.execute('''INSERT INTO Guests (name, contact, email, address)
VALUES (?, ?, ?, ?)''', (self.name, self.contact, self.email,
self.address))
conn.commit()
print(f"Guest {self.name} added successfully.")
conn.close()

@staticmethod
def view_guests():
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()
cursor.execute('''SELECT guest_id, name, contact, email FROM
Guests''')
guests = cursor.fetchall()
for guest in guests:
print(f"ID: {guest[0]}, Name: {guest[1]}, Contact: {guest[2]}, Email:
{guest[3]}")
conn.close()

3. Room Management

Output:
classRoom:
def __init__(self, room_number, room_type, price):
self.room_number = room_number
self.room_type = room_type
self.price = price

def add_room(self):
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()
cursor.execute('''INSERT INTO Rooms (room_number, room_type,
price, status)
VALUES (?, ?, ?, 'Available')''', (self.room_number,
self.room_type, self.price))
conn.commit()
print(f"Room {self.room_number} added successfully.")
conn.close()

@staticmethod
def view_rooms():
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()
cursor.execute('''SELECT room_number, room_type, price, status
FROM Rooms''')
rooms = cursor.fetchall()

for room in rooms:


print(f"Room Number: {room[0]}, Type: {room[1]}, Price:
{room[2]}, Status: {room[3]}")

conn.close()

@staticmethod
def update_room_status(room_number, status):
conn = sqlite3.connect('hotel_management.db')
cursor = conn.cursor()
cursor.execute('''UPDATE Rooms SET status = ? WHERE
room_number = ?''', (status, room_number))
conn.commit()
print(f"Room {room_number} status updated to {status}.")
conn.close()

4. Reservation Management
Output:
class Reservation:

def __init__(self, guest_id, room_id, check_in_date, check_out_date):

self.guest_id = guest_id

self.room_id = room_id

self.check_in_date = check_in_date

self.check_out_date = check_out_date

self.status = 'Confirmed'

def create_reservation(self):

conn = sqlite3.connect('hotel_management.db')

cursor = conn.cursor()

cursor.execute('''INSERT INTO Reservations (guest_id, room_id,


check_in_date, check_out_date, status)

VALUES (?, ?, ?, ?, ?)''', (self.guest_id, self.room_id,


self.check_in_date, self.check_out_date, self.status))

conn.commit()

print(f"Reservation created for Room {self.room_id}.")


conn.close()

@staticmethod

def view_reservations():

conn = sqlite3.connect('hotel_management.db')

cursor = conn.cursor()

cursor.execute('''SELECT res.reservation_id, g.name,


r.room_number, res.check_in_date, res.check_out_date, res.status

FROM Reservations res

JOIN Guests g ON res.guest_id = g.guest_id

JOIN Rooms r ON res.room_id = r.room_id''')

reservations = cursor.fetchall()

for reservation in reservations:

print(f"Reservation ID: {reservation[0]}, Guest: {reservation[1]},


Room: {reservation[2]}, Check-in: {reservation[3]}, Check-out:
{reservation[4]}, Status: {reservation[5]}")

conn.close()

5. Billing and Invoicing


Output:
class Billing:

def __init__(self, reservation_id, amount):

self.reservation_id = reservation_id

self.amount = amount
self.payment_status = 'Pending'

def generate_bill(self):

conn = sqlite3.connect('hotel_management.db')

cursor = conn.cursor()

cursor.execute('''INSERT INTO Billing (reservation_id, amount,


payment_status)

VALUES (?, ?, ?)''', (self.reservation_id, self.amount,


self.payment_status))

conn.commit()

print(f"Bill generated for Reservation {self.reservation_id}. Amount:


{self.amount}")

conn.close()

@staticmethod

def view_bills():

conn = sqlite3.connect('hotel_management.db')

cursor = conn.cursor()

cursor.execute('''SELECT b.bill_id, r.reservation_id, b.amount,


b.payment_status

FROM Billing b

JOIN Reservations r ON b.reservation_id = r.reservation_id''')

bills = cursor.fetchall()

for bill in bills:

print(f"Bill ID: {bill[0]}, Reservation ID: {bill[1]}, Amount: {bill[2]},


Payment Status: {bill[3]}")
conn.close()

6. Hotel Feedback
Output:
class HotelFeedback:

def _init_(self):

self.feedbacks = []

def collect_feedback(self):

name = input("Enter your name: ")

room = input("Room number: ")

rating = int(input("Rate (1-5): "))

comments = input("Comments: ")

if 1 <= rating <= 5:

self.feedbacks.append({"name": name, "room": room, "rating": rating,


"comments": comments})

print("Feedback received!")

else:

print("Invalid rating!")

def show_feedback(self):

if not self.feedbacks:

print("No feedback yet.")

for feedback in self.feedbacks:


print(f"{feedback['name']} (Room {feedback['room']}):
{feedback['rating']}/5 - {feedback['comments']}")

# Example usage

hotel = HotelFeedback()

hotel.collect_feedback()

hotel.show_feedback()

7. Housekeeping Feedback
Output:
class HousekeepingFeedback:

def _init_(self):

self.feedbacks = []

def collect_feedback(self):

room = input("Room number: ")

comments = input("Comments: ")

self.feedbacks.append({"room": room, "comments": comments})

print("Feedback received!")

def show_feedback(self):

if not self.feedbacks:

print("No feedback yet.")

for feedback in self.feedbacks:

print(f"Room {feedback['room']}: {feedback['comments']}")

housekeeping = HousekeepingFeedback()
housekeeping.collect_feedback()

housekeeping.show_feedback()

8. Inventory
Output:
class Inventory:

def _init_(self):

self.items = {}

def add_item(self):

item_id = input("Enter item ID: ")

name = input("Enter item name: ")

quantity = int(input("Enter quantity: "))

price = float(input("Enter price in rupees: ₹"))

self.items[item_id] = {"name": name, "quantity": quantity, "price": price}

print(f"{name} (ID: {item_id}) added with quantity {quantity} and price


₹{price:.2f}.")

def show_inventory(self):

if not self.items:

print("Inventory is empty.")

for item_id, details in self.items.items():

print(f"ID: {item_id}, Name: {details['name']}, Quantity:


{details['quantity']}, Price: ₹{details['price']:.2f}")
# Example usage

inventory = Inventory()

inventory.add_item()

inventory.add_item()

inventory.show_inventory()

9. Menu
Order:
def display_menu():

print("\nWelcome to the Hotel! Please choose an item:")

print("1. Burger - ₹300")

print("2. Pasta - ₹500")

print("3. Salad - ₹200")

print("4. Pizza - ₹700")

print("5. Coffee - ₹150")

print("6. Exit")

def get_order():

items = {1: ("Burger", 300), 2: ("Pasta", 500), 3: ("Salad", 200), 4: ("Pizza",


700), 5: ("Coffee", 150)}

order = []

total = 0

while True:

display_menu()

choice = input("Enter the number of the item or '6' to exit: ")


if choice == '6':

break

elif choice.isdigit() and int(choice) in items:

item, price = items[int(choice)]

order.append(item)

total += price

else:

print("Invalid choice, please try again.")

return order, total

def print_receipt(order, total):

print("\nYour Order Summary:")

for item in order:

print(f"- {item}")

print(f"\nTotal: ₹{total}")

print("Thank you for visiting! Have a great day!")

# Main program

order, total = get_order()

print_receipt(order, total)
OUTPUTS
2. Guest Management
USAGE EXAMPLE:

EXPECTED OUTPUT:

3. Room Management
USAGE EXAMPLE:
EXPECTED OUTPUT:

4. Reservation Management
USAGE EXAMPLE:

EXPECTED OUTPUT:
5. Billing and Invoicing
USAGE EXAMPLE:

EXPECTED OUTPUT:

6. Hotel Feedback
USAGE EXAMPLE:
7. Housekeeping Feedback
USAGE EXAMPLE:

8. Inventory
USAGE EXAMPLE:
9. Menu
USAGE EXAMPLE:
MYSQL TABLES USED IN THIS
PROJECT
1. Billing

2. Users

3. Reservation
4. Rooms

5. Menu

6. Housekeeping
7. Inventory

8. Guests

9. Reports
10. Feedback
Bibliography

1. python.org
2. Code Academy
3.tutorialsPoint.com
4. PythonChallenge.com
5. Google’s Python Class
6. LearnPython.org

You might also like