0% found this document useful (0 votes)
52 views11 pages

Airline Ticket Reservation

Uploaded by

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

Airline Ticket Reservation

Uploaded by

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

PROJECT ON

AIRLINE TICKET RESERVATION


create database air;
use air;
create table pdata(custname varchar(20),addr varchar(30),jrdate
varchar(10),source varchar(10),destination varchar(10));

create table classtype(sno varchar(5),classtype varchar(10),price


integer(10));
insert into classtype values('1','Firstclass',6000);
insert into classtype values('2','Businessclass',4000);
insert into classtype values('3','Economyclass',2000);

create table food(sno integer(10),itemname varchar(10),rate


integer(10));
insert into food values(1,"tea",10);
insert into food values(2,"coffee",10);
insert into food values(3,"colddrink",20);
insert into food values(4,"samosa",10);
insert into food values(5,"sandwich",50);
insert into food values(6,"dhokla",30);
insert into food values(7,"kachori",10);
insert into food values(8,"milk",20);
insert into food values(9,"noodles",50);
insert into food values(10,"pasta",50);

create table luggage(sno integer(10),weight varchar(10),rate


integer(10));
insert into luggage values(1,"20kg",1000);
insert into luggage values(2,"25kg",1500);
insert into luggage values(3,"30kg",2000);
insert into luggage values(4,"50kg",3000);

SOURCE CODE
import os
import platform
import mysql.connector
import datetime
global z
mydb=mysql.connector.connect(user='root',password='dps',host
='localhost',datbase='air')
mycursor=mydb.cursor()

def registercust():
L=[]
name=input("Enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
jr_date=input("enter date of journey:")
L.append(jr_date)
source=input("enter source:")
L.append(source)
destination=input("enter destination:")
L.append(destination)
cust=(L)
sql="insert into pdata(custname,addr,jrdate,source,destination)
values(%s,%s,%s,%s,%s)"
mycursor.execute(sql,cust)
mydb.commit()
def classtypeview():
print("Do you want to see class type available: Enter 1 for
yes:")
ch=int(input("enter your choice:"))
if ch==1:
sql="select*from classtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def ticketprice():
print("We have the following rooms for you:-")
print("1. type First class------->rs6000PN\-")
print("1. type Business class------->rs4000PN\-")
print("1. type economy class------->rs2000PN\-")
x=int(input("Enter your choice Please-."))
n=int(input("No of passengers:"))
if(x==1):
print("You have opted first class")
s=6000*n
elif(x==2):
print("You have opted business class")
s=4000*n
elif(x==3):
print("You have opted economy class")
s=2000*n
else:
print("Please choose a class type")
print("Your rent is=",s,"\n")
def menuview():
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()
for x in rows:
print(x)

def orderitem():
global s
print("Do you want to see menu available: Enter 1 for yes:")
ch=int(input("Enter your choice:"))
if(d==1):
print("you have ordered tea")
a=int(input("enter quantity"))
s=10*a
print("your amount for tea is:",s,"\n")
elif(d==2):
print("you have ordered coffee")
a=int(input("enter quantity"))
s=10*a
print("your amount for coffee is:",s,"\n")
elif (d==3):
print("you have ordered colddrink")
a=int(input("enter quantity"))
s=20*a
print("your amount for colddrink is:",s,"\n")
elif(d==4):
print("you have ordered samosa")
a=int(input("enter quantity"))
s=10*a
print("your amount for samosa is:",s,"\n")
elif(d==5):
print("you have ordered sandwich")
a=int(input("enter quantity"))
s=50*a
print("your amount for sandwich is:",s,"\n")
elif(d==6):
print("you have ordered dhokla")
a=int(input("enter quantity"))
s=30*a
print("your amount for dhokla is:",s,"\n")
elif(d=7):
print("you have ordered kachori")
a=int(input("enter quantity"))
s=10*a
print("your amount for kachori is:",s,"\n")
elif(d==8):
print("you have ordered milk")
a=int(input("enter quantity"))
s=20*a
print("your amount for milk is:",s,"\n")
elif(d==9):
print("you have ordered noodles")
a=int(input("enter quantity"))
s=50*a
print("your amount for noodles is:",s,"\n")
elif(d==10):
print("you have ordered pasta")
a=int(input("enter quantity"))
s=50*a
print("your amount for pasta is:",s,"\n")
else:
print("please enter your choice from the menu")
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()
for x in rows:
print(x)
y=int(input("enter your weight of extra luggage->"))
z=y*1000
print("You bill:",z,"\n")
return z
def lb():
print(z)
def res():
print(s)
def ticketamount():
a=input("Enter customer name:")
print("customer name:",a,"\n")
print("luggage bill:")
print(lb)
print("food bill:")
print(res)

def Menuset():
print("enter 1:to enter customer data")
print("enter 2 : to view class")
print("enter 3: for ticketamount")
print("enter 4: for viewing food menu")
print("enter 5: for food bill")
print("enter 6: for luggage bill")
print("enter 7: for complete amount")
print("enter 8: for exit")
userinput=int(input("enter your choice"))
if(userinput==1):
registercust()
elif(userinput==2):
classtypeiew()
elif(userinput==3):
ticketprice()
elif(userinput==4):
menuview()
elif(userinput==5):
orderitem()
elif(userinput==6):
luggagebill()
elif(userinput==7):
ticketmaount()
elif(userinput==8):
quit()
else:
print("enter correct choice")
def runagain():
runagn=input("\n want to run again y/n:")
while(runagn.lower()=='y'):
if(platform.system()=="windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
Menuset()
runagn=input("\n want to run again y/n:")

menuset()
runagain()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy