Brian Jacob and Kiran Biju Python Project
Brian Jacob and Kiran Biju Python Project
PROJECT
AUDITORIUM
MANAGEMENT
SYSTEM
1|Page
STUDENT PARTICULARS
CLASS : XI - A
SIGNATURE :
INDEX
2|Page
SL NO TOPIC PAGE NO
1 Acknowledgement 4
2 Aim 5
3 Brief Explanation 6
4 Source code 7-13
5 Output 14-15
6 Conclusion 16
7 Advantages and 17-18
disadvantages
3|Page
ACKNOWLEDGEMENT
4|Page
AIM
5|Page
BRIEF EXPLAINATION
This code creates an `Auditorium` class with
attributes such as name, capacity, price per hour,
and bookings. It also creates a `Booking` class with
attributes such as auditorium, date, start time, end
time, customer name, customer email, and catering
requirement. The `main()` function creates an
instance of the `Auditorium` class and provides a
menu for the user to view available hours, book the
auditorium, contact staff for inquiry, or exit the
program. The user can input the date, start time,
end time, customer name, customer email, and
catering requirement to book the auditorium. The
program checks for the availability of the
auditorium at the given date and time and
calculates the total cost of the booking. The user
can contact the staff for further inquiry.
6|Page
SOURCE CODE
import datetime
class Auditorium:
def __init__(self, name, capacity, price_per_hour):
self.name = name
self.capacity = capacity
self.price_per_hour = price_per_hour
self.bookings = []
7|Page
for hour in range(8, 22):
available_hours.append(datetime.datetime(date.year,
date.month, date.day, hour))
for booking in self.bookings:
if booking.date == date:
if booking.start_time in available_hours:
available_hours.remove(booking.start_time)
if booking.end_time in available_hours:
available_hours.remove(booking.end_time)
return available_hours
class Booking:
def __init__(self, auditorium, date, start_time, end_time,
customer_name, customer_email, catering_required):
self.auditorium = auditorium
self.date = date
self.start_time = start_time
self.end_time = end_time
self.customer_name = customer_name
8|Page
self.customer_email = customer_email
self.catering_required = catering_required
def get_cost(self):
duration = self.end_time - self.start_time
hours = duration.seconds // 3600
return hours * self.auditorium.price_per_hour
def main():
auditorium = Auditorium("Sagymon Auditorium", 100,
100000)
time = datetime.datetime.now()
print(f"\n\tWELCOME TO {auditorium.name} BOOKING
SYSTEM!\n")
print(f"\tCurrent date and time: {time}")
while True:
print("""
******** Sagymon Auditorium Booking System ********
9|Page
1. View Available Hours
2. Book Auditorium
3. Contact Staff for Inquiry
4. Exit the program
""")
try:
choice = int(input("Enter your choice: "))
except ValueError:
print("Please enter a number!")
continue
if choice == 1:
date_str = input("Enter date (YYYY-MM-DD): ")
try:
date = datetime.datetime.strptime(date_str, "%Y-%m-
%d").date()
except ValueError:
print("Invalid date format!")
10 | P a g e
continue
available_hours = auditorium.get_available_hours(date)
print(f"Available hours on {date_str}:")
for hour in available_hours:
print(hour.strftime("%H:%M"))
elif choice == 2:
date_str = input("Enter date (YYYY-MM-DD): ")
try:
date = datetime.datetime.strptime(date_str, "%Y-%m-
%d").date()
except ValueError:
print("Invalid date format!")
continue
available_hours = auditorium.get_available_hours(date)
print(f"Available hours on {date_str}:")
for hour in available_hours:
print(hour.strftime("%H:%M"))
start_time_str = input("Enter start time (HH:MM): ")
11 | P a g e
try:
start_time =
datetime.datetime.strptime(start_time_str, "%H:%M").time()
except ValueError:
print("Invalid time format!")
continue
end_time_str = input("Enter end time (HH:MM): ")
try:
end_time = datetime.datetime.strptime(end_time_str,
"%H:%M").time()
except ValueError:
print("Invalid time format!")
continue
if datetime.datetime.combine(date, end_time) <=
datetime.datetime.combine(date, start_time):
print("End time must be after start time!")
continue
if datetime.datetime.combine(date, start_time) not in
available_hours or datetime.datetime.combine(date, end_time)
not in available_hours:
12 | P a g e
print("Selected time is not available!")
continue
customer_name = input("Enter your name: ")
customer_email = input("Enter your email: ")
catering_required = input("Do you require catering?
(yes/no): ")
booking = Booking(auditorium, date,
datetime.datetime.combine(date, start_time),
datetime.datetime.combine(date, end_time), customer_name,
customer_email, catering_required)
auditorium.add_booking(booking)
cost = booking.get_cost()
print(f"Booking successful! Total cost: {cost}, Contact us
at 050-2371983 regarding the payment details and the terms of
use of our auditorium.")
elif choice == 3:
print("Contact our Manager at 050-2371983 or through
our email sagymonauditorium@gmail.com for any inquiry.")
13 | P a g e
elif choice == 4:
break
else:
print("Please enter a choice between 1-4 only!")
if __name__ == "__main__":
main()
14 | P a g e
OUTPUT
• View available hours-
• Online booking
15 | P a g e
• Contacting staff
16 | P a g e
17 | P a g e
CONCLUSION
18 | P a g e
ADVANTAGES OF PYTHON
19 | P a g e
DISADVANTAGES OF PYTHON
20 | P a g e