Source Code
Source Code
Source code
By prithika,mathuvanthi,Preethi
roomrent = 0
gamingbill = 0
foodbill = 0
guests = {}
rooms = {}
charges = {}
def display_menu():
print("\n Hotel Management System")
print("1. Check-in")
print("2. Room options and charges")
print("3. Restaurant Charges")
print("4. Entertainment charges")
print("5. Check-out")
print("6. Total charges")
print("7. Display Guest List")
print("8. Display Room Status")
print("9. Exit")
def check_in():
guest_name = input("Enter guest name: ")
room_number = int(input("Enter room number: "))
if room_number in rooms:
print("Room {room_number} is already occupied.")
else:
rooms[room_number] = guest_name
guests[guest_name] = room_number
charges[room_number] = {}
print(f"Check-in successful for {guest_name} in room
{room_number}.")
def roombill():
global roomrent
global rooms
print("\n We have The Following Rooms For You \n")
print(" 1. Ultra Royal> 10000 Rs.")
print(" 2. Royal > 5000 Rs. ")
print(" 3. Elite > 3500 Rs. ")
print(" 4. Budget > 2500 Rs. ")
if roomchoice == 1:
roomrent = noofdays * 10000
print("\nUltra Royal Room Rent : ", roomrent)
elif roomchoice == 2:
roomrent = noofdays * 5000
print("\nRoyal Room Rent : ", roomrent)
elif roomchoice == 3:
roomrent = noofdays * 3500
print("\nElite Royal Room Rent : ", roomrent)
elif roomchoice == 4:
roomrent = noofdays * 2500
print("\nBudget Room Rent : ", roomrent)
else:
print("Sorry, Invalid choice, Please Try Again !!!")
return None
if room_number in rooms:
charges[room_number]['room_rent'] = roomrent
return roomrent
def restaurantbill():
global rooms
global charges
global foodbill
print("1. Vegetarian Combo > 300 Rs.")
print("2. Non-Vegetarian Combo > 500 Rs.")
print("3. Vegetarian & Non-Vegetarian Combo > 750 Rs.")
print("4. No thanks will arrange food by myself")
room_number = int(input("Enter Guest Room No : "))
if room_number not in rooms:
print("Room number doesn't exist.")
return
choice_dish = int(input("Enter Your Choice of cuisine : "))
quantity = int(input("Enter Quantity : "))
noofdays = int(input("enter no of days"))
if choice_dish == 1:
foodbill = quantity * 300 * noofdays
print("\n SO YOU HAVE ORDERED: Vegetarian Combo
and the bill amount is ", foodbill)
elif choice_dish == 2:
foodbill = quantity * 500 * noofdays
print(
"\n SO YOU HAVE ORDERED: Non-Vegetarian Combo
and the bill amount is ", foodbill)
elif choice_dish == 3:
foodbill = quantity * 750 * noofdays
print("\n SO YOU HAVE ORDERED: Vegetarian & Non-
Vegetarian Combo and the bill amount is ", foodbill)
elif choice_dish == 4:
foodbill = 0
print("\n YOU HAVE NOT ORDERED IN OUR
RESTAURANT so the bill amount is ", foodbill)
else:
print("Sorry , Invalid choice, Please Try Again !!! ")
if room_number in charges:
charges[room_number]['food_bill'] = foodbill
else:
charges[room_number] = {'food_bill': foodbill}
return foodbill
def entertainmentbill():
global rooms
global charges
global gamingbill
print("""
1. Table Tennis > 150 Rs./HR
2. Bowling > 100 Rs./HR
3. Snooker > 250 Rs./HR
4. VR World Gaming > 400 Rs./HR
5. Video Games > 300 Rs./HR
6. Swimming Pool Games -----> 350 Rs./HR
7. Not interested to play games
8. Exit
""")
room_number = int(input("Enter Guest Room No : "))
if room_number not in rooms:
print("Room number doesn't exist.")
return
game = int(input("Enter What Game You Want To Play : "))
hour = int(input("Enter No Of Hours You Want To Play : "))
ans = "n"
if game == 1:
gamingbill = hour * 150
print("YOU HAVE SELECTED TO PLAY : Table Tennis
and the bill amount is", gamingbill)
elif game == 2:
gamingbill = hour * 100
print("YOU HAVE SELECTED TO PLAY : Bowling and
the bill amount is", gamingbill)
elif game == 3:
gamingbill = hour * 250
print("YOU HAVE SELECTED TO PLAY : Snooker and
the bill amount is", gamingbill)
elif game == 4:
gamingbill = hour * 400
print(
"YOU HAVE SELECTED TO PLAY : VR World Gaming
and the bill amount is", gamingbill)
elif game == 5:
gamingbill = hour * 300
print("YOU HAVE SELECTED TO PLAY : Video Games
and the bill amount is", gamingbill)
elif game == 6:
gamingbill = hour * 350
print("YOU HAVE SELECTED TO PLAY : Swimming Pool
Games and the bill amount is", gamingbill)
elif game == 7:
ans = input("Are you sure you dont want to play y/n")
if ans == 'y':
gamingbill = 0
print("YOU HAVE NOT SELECTED TO PLAY ANY
GAME so the bill amount is", gamingbill)
else:
print("Sorry ,Invalid choice, Please Try Again !!! ")
if room_number in charges:
charges[room_number]['gamingbill'] = gamingbill
else:
charges[room_number] = {'gamingbill': gamingbill}
return gamingbill
def check_out():
guest_name = input("Enter guest name: ")
if guest_name in guests:
room_number = guests.pop(guest_name)
del rooms[room_number]
print(
f"Check-out successful for {guest_name} from room
{room_number}.")
else:
print(f"Guest {guest_name} not found.")
def totalbill():
global charges
for room_number, bills in charges.items():
total = 0
for bill_type, amount in bills.items():
total += amount
print(f"Total charges for room {room_number}: {total}")
def display_guest_list():
print("\nGuest List:")
for guest, room in guests.items():
print(f"{guest} - Room {room}")
def display_room_status():
print("\nRoom Status:")
for room, guest in rooms.items():
print(f"Room {room} - Occupied by {guest}")
while True:
display_menu()
choice = input("Enter your choice: ")
if choice == "1":
check_in()
elif choice == '2':
roombill()
elif choice == '3':
restaurantbill()
elif choice == '4':
entertainmentbill()
elif choice == "5":
check_out()
elif choice == "6":
totalbill()
elif choice == "7":
display_guest_list()
elif choice == "8":
display_room_status()
elif choice == "9":
print("Thank you for using the Hotel Management System.
Goodbye!")
break
else:
print("Invalid choice. Please try again.")