Case Study:Movie Ticket Booking System

In today’s digital age, movie ticket booking systems have become an essential part of the entertainment industry. The Movie Ticket Booking System presented here is a simplified text-based application created using Python. It allows users to view available seats, purchase movie tickets, and access booking statistics. This case study showcases a straightforward implementation of a movie ticket booking system.

Objectives:

  1. To provide an easy-to-use interface for booking movie tickets.
  2. To display available seats and their status (booked or available).
  3. To calculate and display booking statistics.
  4. To create a simple and functional movie ticket booking system in Python.
class MovieTicketBookingSystem: def __init__(self, rows, seats_per_row): self.rows = rows self.seats_per_row = seats_per_row self.seating = [[False] * seats_per_row for _ in range(rows)] self.total_seats = rows * seats_per_row self.current_income = 0 self.total_income = 0 self.calculate_total_income() def calculate_total_income(self): if self.total_seats ") def buy_ticket(self, row, seat): if self.seating[row - 1][seat - 1]: print("This seat is already booked. Please select another seat.") return False ticket_price = 10 if self.total_seats ") if input("Do you want to book this ticket? (yes/no): ").lower() == "yes": self.seating[row - 1][seat - 1] = True self.current_income += ticket_price return True return False def get_statistics(self): percentage_booked = (sum(row.count(True) for row in self.seating) / self.total_seats) * 100 return f"Number of purchased tickets: \n" \ f"Percentage: %\n" \ f"Current income: $\n" \ f"Total income: $" def main(): rows = int(input("Enter the number of rows: ")) seats_per_row = int(input("Enter the number of seats in each row: ")) booking_system = MovieTicketBookingSystem(rows, seats_per_row) while True: print("\n1. Show the seats") print("2. Buy a ticket") print("3. Statistics") print("0. Exit") choice = int(input("Enter your choice: ")) if choice == 1: booking_system.display_seating() elif choice == 2: row = int(input("Enter the row number: ")) seat = int(input("Enter the seat number: ")) if 1 

Output:

Implementation:

The Movie Ticket Booking System includes the following components:

Case Study Steps:

  1. Launch the Movie Ticket Booking System.
  2. Input the number of rows and seats per row, configuring the theater.
  3. Select options from the menu to view available seats, purchase tickets, or check booking statistics.
  4. To view available seats, select option ‘1’. The system displays the current seating arrangement.
  5. To buy a ticket, select option ‘2’. Specify the row and seat number, and the system will calculate the ticket price. Confirm the purchase or cancel.
  6. To view booking statistics, select option ‘3’. The system displays the number of purchased tickets, the percentage of booked seats, and the current and total income.
  7. To exit the system, select option ‘0’.

Conclusion:

The Movie Ticket Booking System presented in this case study demonstrates the fundamental concepts of creating a movie ticket booking application using Python. Although this is a basic text-based implementation, it highlights the essential components of a real-world movie ticket booking system, such as seat availability, pricing, and booking statistics. Further development could include a graphical user interface (GUI) and database integration for a more user-friendly and robust system.