CS Project
CS Project
2024 - 2025
Principal
ACKNOWLEDGEMENT
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
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!
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 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}")
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 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
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!
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