Main Program
Main Program
connector as sql
conn = sql.connect(host='localhost', user='root', password='harini0803',
database='Theatre')
c1 = conn.cursor()
if not conn.is_connected():
print('invalid')
else:
print("**********WELCOME TO XII-C THEATRE**********")
print('~~~~~~~~~~ XII-C THEATRE BOOKING (AC & NON AC) ~~~~~~~~~~')
ch = int(input("Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class 4.2nd
Class :"))
if ch == 1:
name = input("Enter the movie name :")
phno = input("Enter phone number :")
tic = int(input("Enter total tickets :"))
gender = input("Enter your gender :")
fname = input("Enter your first name :")
lname = input("Enter your last name :")
passwd = input("Enter your passwd :")
userID = input("Enter your userID :")
snacks = input("Order your snacks :")
price = tic*100
ins = f"insert into ticket_booking
values('{name}','{phno}','{tic}','{gender}','{fname}','{lname}','{passwd}','{userID}','
{snacks}','{price}')"
c1.execute(ins)
conn.commit()
print("******************TICKETS BOOKED******************")
print('******************THANK YOU COME AGAIN*******************')
a = input('Do you want to continue?(yes/no)')
while a=='yes':
ch = int(input("Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class
4.2nd Class :"))
break
if ch==2:
print("******************WELCOME TO XII-C THEATRE*******************")
print("################ WELCOME TO THE BOX OFFICE (AC)##################")
name = input("Enter the movie name :")
phno = input("Enter phone number :")
tic = int(input("Enter total tickets :"))
gender = input("Enter your gender :")
fname = input("Enter your first name :")
lname = input("Enter your last name :")
passwd = input("Enter your passwd :")
userID = input("Enter your userID :")
snacks = input("Order your snacks :")
price = tic * 500
ins = f"insert into box_office
values('{name}','{phno}','{tic}','{gender}','{fname}','{lname}','{passwd}','{userID}','
{snacks}','{price}')"
c1.execute(ins)
conn.commit()
print("*********************TICKETS BOOKED***********************")
print('******************THANK YOU COME AGAIN*******************')
a = input('Do you want to continue?(yes/no)')
while a == 'yes':
ch = int(input("Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class
4.2nd Class :"))
break
if ch==3:
print("************welcome to 1st class ticket booking **************")
name = input("Enter the movie name :")
phno = input("Enter phone number :")
tic = int(input("Enter total tickets :"))
gender = input("Enter your gender :")
fname = input("Enter your first name :")
lname = input("Enter your last name :")
passwd = input("Enter your passwd :")
userID = input("Enter your userID :")
snacks = input("Order your snacks :")
price = tic * 300
ins = f"insert into 1st_class
values('{name}','{phno}','{tic}','{gender}','{fname}','{lname}','{passwd}','{userID}','
{snacks}','{price}')"
c1.execute(ins)
conn.commit()
print("*********************TICKETS BOOKED***********************")
print('******************THANK YOU COME AGAIN*******************')
a = input('Do you want to continue?(yes/no)')
while a == 'yes':
ch = int(input("Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class
4.2nd Class :"))
break
if ch == 4:
print("*************WELCOME TO XII-C THEATRE*************")
print ("!!!!!!!!!!!!WELCOME TO 2nd CLASS TICKET BOOKING !!!!!!!!!!!!!!")
name = input("Enter the movie name :")
phno = input("Enter phone number :")
tic = int(input("Enter total tickets :"))
gender = input("Enter your gender :")
fname = input("Enter your first name :")
lname = input("Enter your last name :")
passwd = input("Enter your passwd :")
userID = input("Enter your userID :")
snacks = input("Order your snacks :")
price = tic * 200
ins = f"insert into 2nd_class values(
'{name}','{phno}','{tic}','{gender}','{fname}','{lname}','{passwd}','{userID}','{snacks
}','{price}')"
c1.execute(ins)
conn.commit()
print("*********************TICKETS BOOKED***********************")
print('******************THANK YOU COME AGAIN*******************')
a = input('Do you want to continue?(yes/no)')
while a == 'yes':
ch = int(input("Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class
4.2nd Class :"))
break
OUTPUT
C:\Users\Admin\PycharmProjects\pythonProject\venv\Scripts\python.exe
C:\Users\Admin\PycharmProjects\pythonProject\main.py
**********WELCOME TO XII-C THEATRE**********
~~~~~~~~~~ XII-C THEATRE BOOKING (AC & NON AC) ~~~~~~~~~~
Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class 4.2nd Class :1
Enter the movie name :bigil
Enter phone number :9710310742
Enter total tickets :5
Enter your gender :male
Enter your first name :arun
Enter your last name :manick
Enter your passwd :am45
Enter your userID :manickarun
Order your snacks :puff
******************TICKETS BOOKED******************
******************THANK YOU COME AGAIN*******************
Do you want to continue?(yes/no)yes
Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class 4.2nd Class :2
******************WELCOME TO XII-C THEATRE*******************
################ WELCOME TO THE BOX OFFICE (AC)##################
Enter the movie name :varisu
Enter phone number :9654323914
Enter total tickets :5
Enter your gender :female
Enter your first name :priya
Enter your last name :ram
Enter your passwd :pr91
Enter your userID :priya5632ram
Order your snacks :coke
*********************TICKETS BOOKED***********************
******************THANK YOU COME AGAIN*******************
Do you want to continue?(yes/no)yes
Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class 4.2nd Class :3
************welcome to 1st class ticket booking **************
Enter the movie name :thuppaki
Enter phone number :9136457134
Enter total tickets :2
Enter your gender :female
Enter your first name :likitha
Enter your last name :sankar
Enter your passwd :lis5
Enter your userID :likisankar9135
Order your snacks :cake
*********************TICKETS BOOKED***********************
******************THANK YOU COME AGAIN*******************
Do you want to continue?(yes/no)yes
Enter your choice 1.Ticket Booking 2.Box Office 3.1st Class 4.2nd Class :4
*************WELCOME TO XII-C THEATRE*************
!!!!!!!!!!!!WELCOME TO 2nd CLASS TICKET BOOKING !!!!!!!!!!!!!!
Enter the movie name :beast
Enter phone number :9416340136
Enter total tickets :4
Enter your gender :male
Enter your first name :praveen
Enter your last name :raman
Enter your passwd :pr01
Enter your userID :praveramu4512
Order your snacks :chips
*********************TICKETS BOOKED***********************
******************THANK YOU COME AGAIN*******************
Do you want to continue?(yes/no)no