(SESSION – 2024 -2025)
NAME – MAYANK
CLASS – XII C
ROLL NO. –
SUBJECT – COMPUTER SCIENCE
SUB CODE - 083
CERTIFICATE
This is to certify that MAYANK of class XII-C has
prepared the report on the project entitled
“HOTEL MANAGEMENT”. The report is the
result of his efforts and endeavors. The report
is found worthy of acceptance as the final
project report for the subject of computer
science of class XII, He has prepared the report
under the guidance of the subject teacher
“Mrs. NEETU VARSHNEY”.
SIGNATURE:
ACKNOWLEDGEMENT
I would like to thank Sh. Avneesh Kumar
Pathak, principal of Kendriya Vidyalaya Delhi
Cantt. I am deeply indebted to our mentor
Neetu Varshney, PGT-Computer Science. I
further thank all the staff members of the
Kendriya Vidyalaya Delhi Cantt and my
heartfelt thanks to CBSE. I also express my
deepest gratitude to my parents who helped
me throughout every endeavor.
AIM
The project on hotel management is a general
software developed (using Python) to simplify
hotel operations by automating them. In this
project, “GRANDIOSE’’ is the project’s hotel
name. it covers major aspects of hotel
management. It could perform the following
info, Room availability, Billing, and Record-
keeping.
What Is a CSV File?
A CSV file (Comma Separated Values file) is a type of plain
text file that uses specific structuring to arrange tabular
data. Because it’s a plain text file, it can contain only
actual text data—in other words, printable ASCII or
Unicode characters. The structure of a CSV file is given
away by its name. Normally, CSV files use a comma to
separate each specific data value.
CODE
import csv
print("HOTEL GRANDIOSE")
def add_room():
room_number = input("Enter Room Number: ")
room_type = input("Enter Room Type: ")
room_rate = float(input("Enter Room Rate: "))
availability = True # Assuming newly added rooms are
available
with open('rooms.csv', 'a', newline='') as file:
writer = csv.writer(file)
writer.writerow([room_number, room_type, room_rate,
availability])
print("Room added successfully!")
def check_availability():
room_number = input("Enter Room Number to check
availability: ")
rows = read_csv('rooms.csv')
for row in rows:
if row[0] == room_number:
if row[3] == 'True':
print("Room", room_number, "is available.")
else:
print("Room", room_number, "is not available.")
return
print("Room not found.")
def book_room():
room_number = input("Enter Room Number to book: ")
rows = read_csv('rooms.csv')
for row in rows:
if row[0] == room_number:
if row[3] == 'True':
row[3] = 'False'
write_csv('rooms.csv', rows)
print("Room", room_number, "has been booked.")
else:
print("Room", room_number, "is not available for
booking.")
return
print("Room not found.")
def costumer_data():
name=input("\nEnter your Fullname:")
address=input("\nEnter your address:")
indate=input("\nEnter your check in date:")
outdate=input("\nEnter your checkout date:")
print('data added successfully')
print('costumer name:',name)
print('costumer address:',address)
print('in date:', indate)
print('out date:', outdate)
5
def roomrent():
print ("We have the following rooms for you:-")
print ("1. Class A --- >4000")
print ("2. Class B --- >3000")
print ("3. Class C --- >2000")
print ("4. Class D --- >1000")
x=int(input("Enter the number of your choice Please-
>"))
n=int(input("For How Many Nights Did You Stay:"))
if(x==1):
print ("you have choose room Class A")
s=4000*n
elif (x==2):
print ("you have choose room Class B")
s=3000*n
elif (x==3):
print ("you have choose room Class C")
s=2000*n
elif (x==4):
print ("you have choose room Class D")
s=1000*n
else:
print ("please choose a room")
print ("your choosen room rent is =",s,"\n")
7
def read_csv(file_name):
with open(file_name, 'r') as file:
reader = csv.reader(file)
return list(reader)
def write_csv(file_name, rows):
with open(file_name, 'w', newline='') as file:
writer = csv.writer(file)
writer.writerows(rows)
while True:
print("\nHotel Management System")
print("1. Add Room")
print("2. Check Room Availability")
print("3. Book Room")
print("4. Costumer_Data")
print("5. Calculate room rent")
print("6. Exit")
choice = input("Enter your choice: ")
if choice == '1':
add_room()
elif choice == '2':
check_availability()
elif choice == '3':
book_room()
elif choice == '4':
costumer_data()
elif choice == '5':
roomrent()
elif choice == '6':
print("Exiting the program.")
break
else:
print("Invalid choice. Please try again.")
OUTPUT
Bibliography
www.google.com
www.slideshare.net
www.wikipedia.com
Computer Science with Python by Sumita
Arora Class XIIth (Book)