Class XII Computer Science Project 1 (1) - 1
Class XII Computer Science Project 1 (1) - 1
TABLE OF CONTENTS
1. Project Description
2. Glimpses of Python
3. Glimpses of MySQL
4. Hardware and
Software Configuration
5. Tables in the Database
6. Source code
7. Output
8. Bibliography
PROJECT DESCRIPTION
The project Air ticket reservation uses Python as front end and MySql as backend. It
aims to maintain the details of booking, payment, seats and flights. It tracks all the
details about seats, flights and payments and prints various report as per input given
by the user.
Python is an open source language that’s free to use and has a wide range
of features that make it easy to customize.
PYTHON FEATURES AND ADVANTAGES
Easy to Learn:
Versatile:
Extensive Libraries:
Cross-Platform:
Community Support:
Integration Friendly:
Rapid Development:
Open Source:
RAM : 4GB
SOFTWARE
Windows OS
def luggagebill():
global z
print("Do you want to see rate for luggage : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from luggage"
mycursor.execute(sql)
rows=mycursor.fetchall()
print(rows)
y=int(input("Enter Your weight of extra luggage->"))
z=y*2000
print("your luggage bill:",z,"\n")
Menuset()
def ticketamount():
a=input("enter customer name:")
print("customer name :",a,"\n")
print("luggage bill:",z)
print("ticket cost:", c)
print("food bill:",s)
print("Total amount:",z+s+c+1000)
Menuset()
def Menuset():
print("AIR TICKET RESERVATION")
print("1: To enter customer data")
print("2 : for class type")
print("3 : for food bill")
print("4 : for luggage bill")
print("5 : for complete amount")
print("6 : for exit")
try:
userinput=int(input("please select an above option:"))
except ValueError:
exit("\n hi thats not a number")
userinput=int(input("confirm your option:"))
if(userinput==1):
registercust()
elif(userinput==2):
classtype()
elif(userinput==3):
orderitem()
elif(userinput==4):
luggagebill()
elif(userinput==5):
ticketamount()
elif(userinput==6):
print("THANKYOU FOR CHOOSING OUR AIRLINES :)")
quit()
else:
print("enter correct choice")
def registercust():
L=[]
name=input("enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
jr_date=input("enter date of journey(YYYY-MM-DD):")
L.append(jr_date)
source=input("enter departure:")
L.append(source)
destination=input("enter destination:")
L.append(destination)
cust=(L)
sql="insert into\
pdata(customer_name,address,jrdate,departure,destination)values(%s,%s,%s,%s,%s)"
mycursor.execute(sql,cust)
mydb.commit()
sb=input("do you want to add more records(y/n)?")
if (sb=="y"):
registercust()
def classtype():
global c
print ("We have the following rooms for you:-")
print ("1. type First class >rs 60000 PN\-")
print ("2. type Business class >rs 40000 PN\-")
print ("3. type Economy class >rs 20000 PN\-")
x=int(input("Enter Your Choice Please->"))
n=int(input("No of passenger:"))
if(x==1):
print ("you have opted First class")
c=60000*n
elif (x==2):
print ("you have opted Business class")
c=40000*n
elif (x==3):
print ("you have opted Economy class")
c=20000*n
else:
print ("please choose a class type")
print ("your room rent is =",s,"\n")
Menuset()
def orderitem():
global s
print("Do you want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from food"
mycursor.execute(sql)
rows=mycursor.fetchall()
print(rows)
ans='y'
while ans=='y':
print("for odering your food,enter the respective number:")
d=int(input("enter your choice:"))
if(d==1):
print("you have ordered tea")
a=int(input("enter quantity"))
s=200*a
print("your amount for tea is :",s,"\n")
elif (d==2):
print("you have ordered coffee")
a=int(input("enter quantity"))
s=250*a
print("your amount for coffee is :",s,"\n")
elif(d==3):
print("you have ordered colddrink")
a=int(input("enter quantity"))
s=400*a
print("your amount for colddrink is :",s,"\n")
elif(d==4):
print("you have ordered french fries")
a=int(input("enter quantity"))
s=500*a
print("your amount for french fries is :",s,"\n")
elif(d==5):
print("you have ordered sandwich")
a=int(input("enter quantity"))
s=600*a
print("your amount for sandwich is :",s,"\n")
elif(d==6):
print("you have ordered nuggets ")
a=int(input("enter quantity"))
s=500*a
print("your amount for nuggets is :",s,"\n")
elif(d==7):
print("you have ordered pizza")
a=int(input("enter quantity"))
s=1000*a
print("your amount for pizza is :",s,"\n")
elif(d==8):
print("you have ordered milk")
a=int(input("enter quantity"))
s=100*a
print("your amount for milk is :",s,"\n")
elif(d==9):
print("you have ordered spaghetti")
a=int(input("enter quantity"))
s=750*a
print("your amount for spaghetti is :",s,"\n")
elif(d==10):
print("you have ordered macaroni")
a=int(input("enter quantity"))
s=750*a
print("your amount for macaroni is :",s,"\n")
else:
print("invalid option")
ans=input("do u want to continue y/n")
else:
Menuset()
def res():
print(s)
print(ticketamount)
Menuset()
def runagain():
runagn=input("\n want to run again y/n:")
if (runagn.lower()=='y'):
Menuset()
else:
print("THANK YOU FOR YOUR COOPERATION")
quit()
runagain()
OUTPUT
BIBLIOGRAPHY
http://www.google.com/
http://www.scribd.com/