0% found this document useful (0 votes)
16 views4 pages

Corrected Movie Ticket Booking Project

Uploaded by

saifshekh991790
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Corrected Movie Ticket Booking Project

Uploaded by

saifshekh991790
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Movie Ticket Booking System - Project Report

1. Introduction

The Movie Ticket Booking System allows users to book movie tickets, calculates the total price including

GST, and displays booking summaries. It demonstrates Python fundamentals like classes, methods, input

validation, and data handling.

2. Class: MovieTicketBooking

This class manages the entire booking process. It holds data about available movies, GST rate, and

maintains a record of bookings.

3. Method: __init__

Initializes the system with predefined movies and prices. Also sets the GST rate to 18% and prepares an

empty dictionary for storing bookings.

4. Method: display_movies

Lists all available movies with their respective ticket prices. Uses enumerate to provide an indexed list.

5. Method: select_movie

Prompts the user to select a movie by entering a number. Includes error handling for invalid inputs and

ensures the choice is within range.

6. Method: get_ticket_count

Asks the user to specify how many tickets to book. Ensures the input is a positive integer using error

handling.
Movie Ticket Booking System - Project Report

7. Method: calculate_total

Calculates the total ticket cost including GST. Takes the selected movie and number of tickets as input and

returns the total cost and GST per ticket.

8. Method: book_ticket

Handles the end-to-end booking process. Calls other methods to select the movie, get ticket count, and

calculate the final amount. Displays a confirmation summary.

9. Method: show_bookings

Displays a summary of all bookings made. If no bookings exist, it informs the user.

10. Function: main

Acts as the main control loop of the program, providing a menu-driven interface for booking tickets, viewing

bookings, or exiting the application.

11. Program Code

Below is the complete source code of the Movie Ticket Booking System, provided for reference and detailed

understanding of the implementation.

12. Source Code

class MovieTicketBooking:
def __init__(self):
self.movies = {
"Avatar": 300.00,
"Inception": 250.00,
"The Lion King": 200.00,
"Titanic": 180.00
Movie Ticket Booking System - Project Report
}
self.bookings = {}
self.gst_rate = 18

def display_movies(self):
print("Available Movies:")
for idx, (movie, price) in enumerate(self.movies.items(), start=1):
print(f"{idx}. {movie} - Rs {price:.2f}")

def select_movie(self):
while True:
try:
choice = int(input("Enter the movie number to book tickets: "))
if 1 <= choice <= len(self.movies):
return list(self.movies.keys())[choice - 1]
else:
print("Invalid choice. Please choose a valid movie number.")
except ValueError:
print("Invalid input. Please enter a number.")

def get_ticket_count(self):
while True:
try:
tickets = int(input("Enter the number of tickets you want to book: "))
if tickets > 0:
return tickets
else:
print("Please enter a number greater than 0.")
except ValueError:
print("Invalid input. Please enter a valid number of tickets.")

def calculate_total(self, movie, ticket_count):


price_per_ticket = self.movies[movie]
gst_amount = (price_per_ticket * self.gst_rate) / 100
total_price = (price_per_ticket + gst_amount) * ticket_count
return total_price, gst_amount

def book_ticket(self):
self.display_movies()
movie = self.select_movie()
ticket_count = self.get_ticket_count()
total_price, gst_amount = self.calculate_total(movie, ticket_count)
self.bookings[movie] = self.bookings.get(movie, 0) + ticket_count
print(f"\nBooking Confirmed!")
print(f"Movie: {movie}")
print(f"Tickets: {ticket_count}")
print(f"GST Amount per Ticket: Rs {gst_amount:.2f}")
print(f"Total Price (Including GST): Rs {total_price:.2f}")

def show_bookings(self):
if not self.bookings:
Movie Ticket Booking System - Project Report
print("No bookings yet.")
else:
print("\nBooking Summary:")
for movie, count in self.bookings.items():
print(f"{movie}: {count} tickets")

def main():
booking_system = MovieTicketBooking()
while True:
print("\nMovie Ticket Booking System")
print("1. Book Tickets")
print("2. Show Bookings")
print("3. Exit")
choice = input("Enter your choice: ")
if choice == "1":
booking_system.book_ticket()
elif choice == "2":
booking_system.show_bookings()
elif choice == "3":
print("Exiting the system. Goodbye!")
break
else:
print("Invalid choice. Please try again.")

You might also like