0% found this document useful (0 votes)
5 views25 pages

CS Project

The document outlines a Computer Science project by Shashank Kumar Verma on a Hotel Management System designed to streamline hotel operations such as room booking, guest management, and billing. It includes sections on hardware and software requirements, project objectives, source code, and sample outputs. The system aims to enhance efficiency, accuracy, and customer satisfaction in hotel management.

Uploaded by

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

CS Project

The document outlines a Computer Science project by Shashank Kumar Verma on a Hotel Management System designed to streamline hotel operations such as room booking, guest management, and billing. It includes sections on hardware and software requirements, project objectives, source code, and sample outputs. The system aims to enhance efficiency, accuracy, and customer satisfaction in hotel management.

Uploaded by

Shashank Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Computer Science Project

2024 - 2025

Shashank Kumar Verma


XII - B
CERTIFICATE

This is to certify that SHASHANK KUMAR VERMA


of class 12th - B of SAHODAY SR. SEC. SCHOOL has done his
project on HOTEL MANAGEMENT SYSTEM under my
supervision. He has taken interest and has shown at most
sincerity in completion of this project.

I certify this project up to my expectation & as per guidelines


issued by CBSE, NEW DELHI.

Internal Examiner External Examiner

Principal
ACKNOWLEDGEMENT

It is with pleasure that I acknowledge my sincere


gratitude to our teacher, Mr. Alaric Anurag Lal who
taught and undertook the responsibility of teaching
the subject computer science. I have been greatly
benefited from his classes. I am especially indebted
to our Principal Sr. Jeevan Latha who has always
been a source of encouragement and support and
without whose inspiration this project would not
have been a successful I would like to place on
record heartfelt thanks to him. Finally, I would like
to express my sincere appreciation for all the other
students for my batch their friendship & the fine
time that we all shared together.
Hardware and Software
Required
Hardware:
• Computer/Server :
You'll need a computer or server to run the program. Any modern
computer should be sufficient, whether it's a laptop, desktop,
or dedicated server.
• Storage :
Ensure you have enough storage space for the CSV file
and the program itself.
• Backup Storage :
Optional but recommended for regular backups of your csv file.

Software:
• Operating System :
The program can run on various operating systems, including Windows,
macOS, and Linux.
• Python :
You'll need Python installed on your system. Python 3.x is recommended.
• Csv :
A built - in Python library to handle CSV file operations
INDEX

Serial No. Content


1 Certificate
2 Acknowledgement
3 Hardware & Software
4 Description
5 Objective
6 Source Code
7 Excel Sheets
8 Output
9 Refrences
DESCRIPTION
Overview:
The Hotel Management System for Royal Retreat is a comprehensive software
application designed to streamline various hotel operations, including room
booking, guest check-ins and check-outs, billing, and record management.
The system aims to enhance the overall guest experience by ensuring efficiency,
accuracy, and excellent service.

Key Features:
1. Room Management:
• Booking and Availability:
The system allows for easy room booking and checks room availability
in real-time.
Guests can book single or double rooms based on their preferences.
• Room Customization:
Administrators can add, update, and delete room information, ensuring
that the room database is always up to date.

2. Guest Management:
• Check-In and Check-Out:
Simplified check-in and check-out processes that
update room statuses and guest information in the system.
• Current Guests:
View details of current guests, including room numbers and the
duration of their stay.
3. Billing and Payments:
• Billing Generation:
Automatically generate detailed bills for guests, including
room charges, service taxes, and any additional services availed
during their stay.
• Service Tax Calculation:
Calculate a 14% service tax on the total bill amount.

4. Record Management:
• CSV File :
All guest records, room bookings, and financial transactions are stored
in a csv file, ensuring data integrity and easy retrieval.
• Display Records:
Display all records in a neat, tabular format using csv file
for easy reference.

5. User Interface:
• Main Menu:
A user-friendly main menu that provides easy navigation through
various functionalities like room management, guest management,
billing, and record display.
• Customization Options:
Administrators can customize room details, manage room availability,
and update room pricing.
OBJECTIVE
Efficiency :
Streamline hotel operations and reduce manual work by automating
room bookings, check-ins, and billing processes.
Accuracy :
Ensure accurate record-keeping and financial transactions to prevent
errors and discrepancies.
Customer Satisfaction :
Enhance guest experience by providing a seamless and efficient
management system that caters to their needs.

Conclusion :-
The Hotel Management System for Royal Retreat is designed
to provide a robust, efficient, and user-friendly solution for
managing hotel operations.
By integrating modern technologies and best practices, the system
aims to enhance operational efficiency and deliver exceptional
guest experiences.
SOURCE CODE
(PYTHON)
print("\n","ROYAL RETREAT".center(90),"\n")
print('''Welcome to Royal Retreat's Operating Menu!

We're thrilled to have you as a key part of our team. As you embark on your shift,
we hope you find the system both intuitive and efficient for recording transactions
and generating bills. Your meticulous attention to detail in maintaining accurate
records and providing exceptional service to our valued guests is deeply appreciated.

By ensuring smooth billing operations and keeping precise records, you contribute
to the seamless experience that Royal Retreat is known for. Let's work together to
make this a productive and enjoyable day!

Warm regards, Royal Retreat's Management Team.''')

import csv
import os

class Room:
def __init__(self, number, room_type, price, is_available=True, guest=None, nights=0):
self.number = number
self.room_type = room_type
self.price = price
self.is_available = is_available
self.guest = guest
self.nights = nights
def book(self, guest, nights):
if self.is_available:
self.is_available = False
self.guest = guest
self.nights = nights
print(f"Room {self.number} booked by {guest} for {nights} night(s)")
else:
print(f"Room {self.number} is not available")

def checkout(self):
if not self.is_available:
total_cost = self.price * self.nights
print(f"{self.guest} checked out from room {self.number}. Total cost: ${total_cost}")
self.is_available = True
self.guest = None
self.nights = 0
else:
print(f"Room {self.number} is already available")

class Hotel:
def __init__(self, name):
self.name = name
self.rooms = []
self.revenue = 0
self.load_rooms()

def load_rooms(self):
if os.path.isfile('rooms.csv'):
with open('rooms.csv', 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
room = Room(
int(row['Room Number']),
row['Room Type'],
float(row['Price']),
row['Is Available'] == 'True',
row['Guest Name'],
int(row['Nights Stayed'])
)
self.rooms.append(room)

def save_rooms(self):
with open('rooms.csv', 'w', newline='') as csvfile:
fieldnames = ['Room Number', 'Room Type', 'Price', 'Is Available', 'Guest Name', 'Nights Stayed']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for room in self.rooms:
writer.writerow({
'Room Number': room.number,
'Room Type': room.room_type,
'Price': room.price,
'Is Available': room.is_available,
'Guest Name': room.guest,
'Nights Stayed': room.nights
})

def add_room(self, number, room_type, price):


if any(room.number == number for room in self.rooms):
print(f"Room {number} already exists. Please choose a different room number.")
return
room = Room(number, room_type, price)
self.rooms.append(room)
self.save_rooms()

def delete_room(self, room_number):


self.rooms = [room for room in self.rooms if room.number != room_number]
self.save_rooms()

def update_room(self, room_number, room_type=None, price=None):


for room in self.rooms:
if room.number == room_number:
if room_type:
room.room_type = room_type
if price:
room.price = price
self.save_rooms()
return
print(f"Room {room_number} not found")

def book_room(self, room_number, guest, nights):


for room in self.rooms:
if room.number == room_number:
room.book(guest, nights)
self.save_rooms()
return
print(f"Room {room_number} not found")

def checkout_room(self, room_number):


for room in self.rooms:
if room.number == room_number:
self.revenue += room.price * room.nights
self.save_record(room)
room.checkout()
self.save_rooms()
return
print(f"Room {room_number} not found")

def room_status(self):
single_rooms = sum(1 for room in self.rooms if room.room_type == "Single")
double_rooms = sum(1 for room in self.rooms if room.room_type == "Double")
print(f"Total Single Rooms: {single_rooms}")
print(f"Total Double Rooms: {double_rooms}")

for room in sorted(self.rooms, key=lambda x: x.number):


status = "available" if room.is_available else f"occupied by {room.guest}"
print(f"Room {room.number} ({room.room_type}, ${room.price}): {status}")

def available_room_status(self):
print(f"Total Available Rooms: {sum(1 for room in self.rooms if room.is_available)}")
for room in sorted(self.rooms, key=lambda x: x.number):
if room.is_available:
print(f"Room {room.number} ({room.room_type}, ${room.price}): available")

def current_guests(self):
print("Current Guests :-")
found = 0
for room in sorted(self.rooms, key=lambda x: x.number):
if not room.is_available:
print(f"Room {room.number}: {room.guest}, Nights: {room.nights}")
found = 1
if found == 0:
print("\n-- NO GUESTS FOUND --\n\nHotel is empty...")
def generate_bill(self, room_number):
for room in self.rooms:
if room.number == room_number and not room.is_available:
total_cost = room.price * room.nights
service_tax = 0.14 * total_cost
final_cost = total_cost + service_tax
print("\n" + "="*20 + " BILL " + "="*20)
print(f"Hotel: {self.name}")
print(f"Room Number: {room.number}")
print(f"Guest Name: {room.guest}")
print(f"Nights Stayed: {room.nights}")
print(f"Rate per Night: ${room.price}")
print(f"Total Cost: ${total_cost}")
print(f"Service Tax (14%): ${service_tax:.2f}")
print(f"Final Cost: ${final_cost:.2f}")
print("="*46 + "\n")
return
print(f"Room {room_number} not found or already available")

def display_all_records(self):
if os.path.isfile('hotel_records.csv'):
print("All Records :-")
with open('hotel_records.csv', 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row)
else:
print("\nNo records found.")

def save_record(self, room):


file_exists = os.path.isfile('hotel_records.csv')
with open('hotel_records.csv', 'a', newline='') as csvfile:
fieldnames = ['Room Number', 'Guest Name', 'Nights Stayed', 'Total Cost']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
if not file_exists:
writer.writeheader()
writer.writerow({
'Room Number': room.number,
'Guest Name': room.guest,
'Nights Stayed': room.nights,
'Total Cost': room.price * room.nights
})

def print_main_menu():
print("\nMain Menu :-")
print("1. Customize Rooms")
print("2. Book Room")
print("3. Checkout Room")
print("4. Room Status")
print("5. Available Rooms")
print("6. Current Guests")
print("7. Generate Bill")
print("8. Display All Records")
print("9. Exit")

def print_customize_menu():
print("\nCustomize Rooms Menu :-")
print("1. Add Room")
print("2. Delete Room")
print("3. Update Room")
print("4. Back to Main Menu")
def customize_rooms(hotel):
while True:
print_customize_menu()
choice = input("Enter choice: ")

if choice == '1':
number = int(input("Enter room number: "))
room_type = input("Enter room type (Single/Double): ")
price = float(input("Enter room price per night: "))
hotel.add_room(number, room_type, price)
elif choice == '2':
room_number = int(input("Enter room number to delete: "))
hotel.delete_room(room_number)
elif choice == '3':
room_number = int(input("Enter room number to update: "))
room_type = input("Enter new room type (Single/Double) or press enter to skip: ")
price = input("Enter new room price or press enter to skip: ")
price = float(price) if price else None
hotel.update_room(room_number, room_type or None, price)
elif choice == '4':
break
else:
print("Invalid choice. Please try again.")

def main():
hotel = Hotel("Royal Retreat")

while True:
print_main_menu()
choice = input("\nEnter choice: ")
if choice == '1':
customize_rooms(hotel)
elif choice == '2':
room_number = int(input("Enter room number: "))
guest = input("Enter guest name: ")
nights = int(input("Enter number of nights: "))
hotel.book_room(room_number, guest, nights)
elif choice == '3':
room_number = int(input("Enter room number: "))
hotel.checkout_room(room_number)
elif choice == '4':
hotel.room_status()
elif choice == '5':
hotel.available_room_status()
elif choice == '6':
hotel.current_guests()
elif choice == '7':
room_number = int(input("Enter room number to generate bill: "))
hotel.generate_bill(room_number)
elif choice == '8':
hotel.display_all_records()
elif choice == '9':
print(f"Total Revenue: ${hotel.revenue}")
break
else:
print("Invalid choice. Please try again.")

if __name__ == "__main__":
main()
Excel Sheets

Current room stored type -


Room Number Room Type Price Is Available Guest Name Nights Stayed
1 Single 12 FALSE Gurpreet Singh 2
2 Single 13 TRUE 0
3 Double 26 FALSE Ronak Jha 3
4 Double 24 TRUE 0
5 Double 31 FALSE Rashmika Ujala 7
6 Single 18 TRUE 0
7 Double 42 FALSE Ranu Mandal 3
8 Single 17 TRUE 0
9 Double 36 FALSE Gauri Chauhan 5
File Name - rooms

Hotel records till date –

Room Number Guest Name Nights Stayed Total Cost


3 Simran Kaur 1 26
6 Mandeep Rana 4 72
4 Mohan Shrivastava 2 48
4 Tanvi Ahuja 3 72
File Name – hotel_records
OUTPUT
ROYAL RETREAT

Welcome to Royal Retreat's Operating Menu!

We're thrilled to have you as a key part of our team. As you embark on your shift,
we hope you find the system both intuitive and efficient for recording transactions
and generating bills. Your meticulous attention to detail in maintaining accurate
records and providing exceptional service to our valued guests is deeply appreciated.

By ensuring smooth billing operations and keeping precise records, you contribute
to the seamless experience that Royal Retreat is known for. Let's work together to
make this a productive and enjoyable day!

Warm regards, Royal Retreat's Management Team.

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit
Enter choice: 4
Total Single Rooms: 4
Total Double Rooms: 5
Room 1 (Single, $12.0): occupied by Gurpreet Singh
Room 2 (Single, $13.0): available
Room 3 (Double, $26.0): occupied by Ronak Jha
Room 4 (Double, $24.0): available
Room 5 (Double, $31.0): occupied by Rashmika Ujala
Room 6 (Single, $18.0): available
Room 7 (Double, $42.0): occupied by Ranu Mandal
Room 8 (Single, $17.0): available
Room 9 (Double, $36.0): occupied by Gauri Chauhan

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit
Enter choice: 5
Total Available Rooms: 4
Room 2 (Single, $13.0): available
Room 4 (Double, $24.0): available
Room 6 (Single, $18.0): available
Room 8 (Single, $17.0): available

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit

Enter choice: 2
Enter room number: 4
Enter guest name: Tanvi Ahuja
Enter number of nights: 3
Room 4 booked by Tanvi Ahuja for 3 night(s)
Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit

Enter choice: 6
Current Guests :-
Room 1: Gurpreet Singh, Nights: 2
Room 3: Ronak Jha, Nights: 3
Room 4: Tanvi Ahuja, Nights: 3
Room 5: Rashmika Ujala, Nights: 7
Room 7: Ranu Mandal, Nights: 3
Room 9: Gauri Chauhan, Nights: 5

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit
Enter choice: 7
Enter room number to generate bill: 4
==================== BILL ====================
Hotel: Royal Retreat
Room Number: 4
Guest Name: Tanvi Ahuja
Nights Stayed: 3
Rate per Night: $24.0
Total Cost: $72.0
Service Tax (14%): $10.08
Final Cost: $82.08
==============================================

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit

Enter choice: 3
Enter room number: 4
Tanvi Ahuja checked out from room 4. Total cost: $72.0

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit

Enter choice: 8
All Records :-
{'Room Number': '3', 'Guest Name': 'Simran Kaur', 'Nights Stayed': '1', 'Total Cost': '26.0'}
{'Room Number': '6', 'Guest Name': 'Mandeep Rana', 'Nights Stayed': '4', 'Total Cost': '72.0'}
{'Room Number': '4', 'Guest Name': 'Mohan Shrivastava', 'Nights Stayed': '2', 'Total Cost': '48.0'}
{'Room Number': '4', 'Guest Name': 'Tanvi Ahuja', 'Nights Stayed': '3', 'Total Cost': '72.0'}

Main Menu :-
1. Customize Rooms
2. Book Room
3. Checkout Room
4. Room Status
5. Available Rooms
6. Current Guests
7. Generate Bill
8. Display All Records
9. Exit

Enter choice: 9
Total Revenue: $72.0
REFRENCES

• Sumita Arora, Class – 12 Book


• Microsoft Copilot (AI)
• Python Idle
• Wikipedia

You might also like