0% found this document useful (0 votes)
132 views53 pages

Computer Project Final-1 PDF

The document describes an online flight ticket reservation system created by a group of students. It includes an introduction describing the system's purpose of allowing users to book and cancel flight tickets online. It then lists the programming languages and software used to develop the system. The document outlines the main sections and functions available to admins and users.

Uploaded by

Nanda Bose
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)
132 views53 pages

Computer Project Final-1 PDF

The document describes an online flight ticket reservation system created by a group of students. It includes an introduction describing the system's purpose of allowing users to book and cancel flight tickets online. It then lists the programming languages and software used to develop the system. The document outlines the main sections and functions available to admins and users.

Uploaded by

Nanda Bose
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/ 53

1

Air ticket booking


3

Done by:
• ANETT MARY MATHEW (E2-38)
• MINAKSHI NIHARIKA (E2-45)
• NANDA BOSE (E2-46)
• NEHA ANN JOHN (E2-47)
4

ACKNOWLEDGEMENTS

First and foremost we thank Lord Almighty for giving us this thought.

We have taken efforts in this project. However, it wouldn’t have been possible
without the kind support and help of many individuals.

I would like to express my profound sense of gratitude to Rev. Fr. Scaria Ethirett
CMI, Principal, Placid Vidya Vihar and the school for encouraging us throughout the
course and providing us with facilities required to do our project.

I am highly indebted to my Computer teachers, Mrs. Brighty Varghese,Mrs. Jincy


Swarup and Mrs Soby Susan Babu for their invaluable guidance which has sustained
my efforts in all the stages of this project work. Their support is an indispensible in
the successful completion of this project work.

I would also like to thank my parents for their continuous support, encouragement
and timely help.

My thanks and appreciations also go to my fellow classmates and the laboratory


assistant in developing the project and to all the people who have willingly helped
me us with their abilities.
5

CONTENTS:

Sl. Contents Page


No
1. Title page 1

2. Declaration 2

3. Acknowledgement 4

4. Introduction 6

5. Front end and back end 8

6. Data flow diagram 9

7. Hardware and software specification 10

8. Source code 11

9. Sample output 32

10. Conclusion 53

11. Bibliography 52
6

INTRODUCTION :

ONLINE FLIGHT TICKET RESERVATION


At a glance:
Online flight ticket reservation system provides a portal for flight ticket reservation.
This application allows users to book flight tickets from anywhere and anytime. The
user can easily book their tickets and cancel them. The user can view all the details of
the flight and the concerned facilities like class, food details, departure details and so
on for a satisfying and comfortable journey. This system is helpful to both employees
as well as the users. This system provides help to the users as they can inquire about
the flight, its ticket price, available seats, class, food and other related information etc.
and they don’t need to walk to the office.

Software used:

• Python 3.6
• MySql 5.5
• IDLE (Spyder)

The program contains following provisions:

This is an eco-friendly program for booking air tickets. The program runs as many
times as required by the user. The program will ask for your passport number, name,
address, date of birth, if you are an adult etc. One can also specify the date of
departure and destination site. We have fixed Kuwait as our departure site. After
completing your personal details the program has the provision to display the classes
available and the food you prefer to have. Further you will receive a confirmation
message. The program also contains the provision for displaying your customer
details, ticket price and so on. The program also contains complete provision for food
according to your choice. The program contains the food bill and luggage bill. Once
you are satisfied with the booking, we can exit from the program.
7

Method description:

The program is mainly divided into 2 sections:

A. ADMIN

This section enables the admin to manage the database.

1. Create: This allows the admin to create new packages and scrap off the
unwanted data from the database.

2. View: This function helps to search and display the details of a particular
package or an entire database.

3. Update: This helps to modify a record.

4. Delete: This function helps to remove an existing record from a database.

B. USER

This section is meant for the end users.

1. See the packages available: This function allows the user to get
information about the details of the flight.

2. Select: This allows the user to choose and enter their details for the
journey.

3. View: This allows the user to view the ticket and receive the confirmation
message.
8

System specifications:
FRONT END
Python(3.6.5):
Python is an interpreted, high-level and general-purpose programming language.
Python's design philosophy emphasizes code readability with its notable use
of significant whitespace. Its language constructs and object-oriented approach aim to
help programmers write clear, logical code for small and large-scale projects.
Python is dynamically typed and garbage-collected. It supports multiple programming
paradigms, including structured (particularly procedural), object-oriented,
and functional programming. Python is often described as a "batteries included"
language due to its comprehensive standard library

BACK END
My SQL(5.5):
MySQL is an open-source relational database management system (RDBMS). Its
name is a combination of "My", the name of co-founder Michael Widenius's
daughter, and "SQL", the abbreviation for Structured Query Language. A relational
database organizes data into one or more data tables in which data types may be
related to each other; these relations help structure the data. SQL allows a language
programmer to create, modify and extract data from the relational database, as well as
control user access to the database. In addition to relational databases and SQL, an
RDBMS like MySQL works with an operating system to implement a relational
database in a computer's storage system, manages users, allows for network access
and facilitates testing database integrity and creation of backups.
9

DATA FLOW DIAGRAM

AIRLINE TICKET RESERVATION


TO KUWAIT

ADMIN USER EXIT

ENTER
CREATE PASSENGER
DETAILS

VIEW AND
VIEW
SELECT CLASS

VIEW AND SELECT


UPDATE DEPARTURE
LOCATION

VIEW FOOD AND


DELETE BEVERAGES
MENU

GET TICKET

CANCEL TICKET
10

SYSTEM SPECIFICATIONS
Hardware:
• Processor: Intel Pentium
• Memory: 256 MB RAM
Software:
• Operating System : Windows 8.1
• Python 3.6.5
• MySQL 5.5
11

SOURCE
CODE
12
import os
import platform
import datetime
import mysql.connector as msql
import sys
con=msql.connect(host="localhost",user="root",passwd="student",database="airlines")
cur=con.cursor()
print("\t \t \t \t MANN AIRLINES \t \t \t \t")
print()
print("\t \t KERALA TO KUWAIT TICKET BOOKING \t\t")
print()
tick=[]
def cust_register():
L=[]
pasprt_no=input("Enter your passport number:")
L.append(pasprt_no)
title=input("Enter title(Mr/Mrs/Ms):")
L.append(title)
tick.append(title)
cust_first_nme=input("Enter your first name:")
L.append(cust_first_nme)
tick.append(cust_first_nme)
cust_last_nme=input("Enter your last name:")
L.append(cust_last_nme)
tick.append(cust_last_nme)
dob=int(input("Enter your year of birth:"))
L.append(dob)
tick.append(dob)
v_date=datetime.date.today()
V=v_date.year
age=V-dob
L.append(age)
tick.append(age)
gender=input("Enter your sex (M/F):")
L.append(gender)
adrs=input("Enter your address:")
L.append(adrs)
adult=input("Adult (yes/no):")
L.append(adult)
n=adult.lower()
13
tick.append(n)
if adult.lower()=='no':
if age >= 0 and age <= 1:
crib=input("Do you want a crib (yes/no):")
L.append(crib)
tick.append(crib)
else:
crib="no"
L.append(crib)
tick.append("No")
jrny_date=input("Enter the date of journey (YYYY/MM/DD/):")
L.append(jrny_date)
tick.append(jrny_date)
email=input("Enter your email id:")
L.append(email)
mob_no=input("Enter your mobile number:")
L.append(mob_no)
jrny_typ=input("Enter your type of journey (oneway/return):")
L.append(jrny_typ)
tick.append(jrny_typ)
if jrny_typ.capitalize() =="Return":
retn_jrny_date=input("enter the date of return journey (YYYY/MM/DD):")
L.append(retn_jrny_date)
tick.append(retn_jrny_date)
ecr=input("Emigration clearance required (yes/no):")
L.append(ecr)
visa=input("Valid visa available or visa on arrival (vv/voa):")
L.append(visa)
cust=(L)
sql="insert into
p_dta(pasprt_no,title,cust_first_nme,cust_last_nme,dob,age,gender,adrs,adult,crib,jrny_date,email
,mob_no,jrny_typ,retn_jrny_date,ecr,visa)values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s,%s)"
cur.execute(sql,cust)
con.commit()

elif jrny_typ.lower()=='oneway':
tick.append("0000/00/00")
ecr=input("Emigration clearance required(yes/no):")
L.append(ecr)
14
visa=input("Valid visa avaialble or visa on arrival (vv/voa):")
L.append(visa)
cust=(L)
sql="insert into
p_dta(pasprt_no,title,cust_first_nme,cust_last_nme,dob,age,gender,adrs,adult,crib,jrny_date,email
,mob_no,jrny_typ,ecr,visa) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(sql,cust)
con.commit()
elif adult.lower()=='yes':
tick.append("No")
jrny_date =input("Enter the date of journey (YYYY/MM/DD):")
L.append(jrny_date)
tick.append(jrny_date)
email=input("Enter your email id:")
L.append(email)
mob_no=input("Enter your mobile number:")
L.append(mob_no)
jrny_typ=input("Enter your type of journey (oneway/return) :")
L.append(jrny_typ)
tick.append(jrny_typ)
if jrny_typ.capitalize()=='Return':
retn_jrny_date=input("Enter the date of return journey (YYYY/MM/DD) :")
L.append(retn_jrny_date)
tick.append(retn_jrny_date)
ecr=input("Emigration clearance required (yes/no) :")
L.append(ecr)
visa=input("Valid visa available or visa on arrival (vv/voa) :")
L.append(visa)
cust=(L)
sql="insert into
p_dta(pasprt_no,title,cust_first_nme,cust_last_nme,dob,age,gender,adrs,adult,jrny_date,email,mob
_no,jrny_typ,retn_jrny_date,ecr,visa)
values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(sql,cust)
con.commit()
elif jrny_typ.lower()=='oneway':
tick.append("0000/00/00")
ecr=input("Emigration clearance required (yes/no):")
L.append(ecr)
visa=input("Valid visa available or visa on arrival (vv/voa) :")
15
L.append(visa)
cust=(L)
sql="insert into
p_dta(pasprt_no,title,cust_first_nme,cust_last_nme,dob,age,gender,adrs,adult,jrny_date,email,mob
_no,jrny_typ,ecr,visa) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(sql,cust)
con.commit()
def view_cabin():
print("Do yoy want to see cabins available : Enter 1 for yes")
ch=int(input("enter your choice:"))
if ch==1 and tick[8].capitalize()=='Return':
print("1.BUSINESS CLASS")
sql="select * from busi_class"
cur.execute(sql)
rows=cur.fetchall()
for x in rows:
print(x)
print()
print("2.ECONOMIC CLASS")
Sql="select * from eco_class"
cur.execute(Sql)
rows=cur.fetchall()
for y in rows:
print(y)
print()
elif ch==1 and tick[8].capitalize()=='Oneway':
print("1.BUSINESS CLASS")
sql="select * from oneway_busi"
cur.execute(sql)
rows=cur.fetchall()
for x in rows:
print(x)
print()
print("2.ECONOMIC CLASS")
Sql="select * from oneway_eco"
cur.execute(Sql)
rows=cur.fetchall()
for y in rows:
print(y)
print()
16
def ticketprice():
print("Type - 1. for business class")
print("Type - 2. for economic class")
x=int(input("Enter Your Choice :"))
p=input("Enter you're place of departure:")
P=p.capitalize()
tick.append(P)
age=int(tick[4])
if(x==1 and p.lower()=="cochin" and age > 10 and tick[8].lower()=='return'):
print ("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=39000
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DININING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="trivandrum" and age >10 and tick[8].lower()=='return'):
print ("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=38000
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="kannur" and age > 10 and tick[8].lower()=='return'):
print ("You have opted Business class and Kannur as place of departure")
tick.append("Business class")
amt=38500
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="calicut" and age > 10 and tick[8].lower()=='return'):
print ("You have opted Business class and Calicut as place of departure")
tick.append("Business class")
amt=38400
print("TOTAL AMOUNT= Rs",amt)
17
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="cochin" and age >=0 and age < 2 and tick[8].lower()=='return' ):
print("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=39000*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="trivandrum" and age>=0 and age < 2 and tick[8].lower()=='return'):
print("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=38000*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="kannur" and age >= 0 and age < 2 and tick[8].lower()=='return'):
print("You have opted for Business class and Kannur as place of departure")
tick.append("Business class")
amt=38500*(1/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="calicut" and age >= 0 and age < 2 and tick[8].lower()=='return'):
print("You have opted for Business class and Calicut as place of departure")
tick.append("Business class")
amt=38400*1/3
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="cochin" and age >=2 and age <= 10 and tick[8].lower()=='return'):
print("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=39000*(2/3)
18
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="trivandrum" and age >=2 and age <=10 and
tick[8].lower()=='return'):
print("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=38000*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="kannur" and age >=2 and age<=10 and tick[8].lower()=='return'):
print("You have opted for Business class and Kannur as place of departure")
tick.append("Business class")
amt=38500*(2/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="calicut" and age >=2 and age <=10 and tick[8].lower()=='return'):
print("You have opted for Business class and Calicut as place of departure")
tick.append("Business class")
amt=38400*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==2 and p.lower()=="cochin" and age >10 and tick[8].lower()=='return'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=31000
print("TOATL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >10 and tick[8].lower()=='return'):
print("You have opted Economy class and Trivandrum as place of departure")
tick .append("Economy class")
19
amt=30000
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each of piece of baaggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >10 and tick[8].lower()=='return'):
print("You have opted Economy class and Kannur as place of departure")
tick.append("Economy class")
amt=30500
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >10 and tick[8].lower()=='return'):
tick.append("Economy class")
print("You have opted Economy class and Calicut as place of departure")
amt=30400
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="cochin" and age >=0 and age < 2 and tick[8].lower()=='return'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=31000*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >= 0 and age <2 and tick[8].lower()=='return'):
print("You have opted Economy class and Trivandrum as place of departure")
tick.append("Economy class")
amt=30000*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >=0 and age <2 and tick[8].lower()=='return'):
print("You have opted for Economy class and Kannur as place of departure")
tick.append("Economy class")
20
amt=30500*(1/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >=0 and age <2 and tick[8].lower()=='return'):
print("You have opted for Economy class and Calicut as place of departure")
tick.append("Economy class")
amt=30400*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="cochin" and age >=2 and age <=10 and tick[8].lower()=='return'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=31000*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >=2 and age <=10 and
tick[8].lower()=='return'):
print("You have opted Economy class and Trivandrum as place of departure")
tick.append("Economy class")
amt=30000*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >= 2 and age <=10 and tick[8].lower()=='return'):
print("You have opted for Economy class and Kannur as place of departure")
tick.append("Economy class")
amt=30500*(2/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >=2 and age <=10 and tick[8].lower()=='return'):
print("You have opted for Economy class and Calicut as place of departure")
21
tick.append("Economy class")
amt=30400*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif(x==1 and p.lower()=="cochin" and age > 10 and tick[8].lower()=='oneway'):
print ("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=23400
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DININING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="trivandrum" and age >10 and tick[8].lower()=='oneway'):
print ("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=22800
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="kannur" and age > 10 and tick[8].lower()=='oneway'):
print ("You have opted Business class and Kannur as place of departure")
tick.append("Business class")
amt=23100
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="calicut" and age > 10 and tick[8].lower()=='oneway'):
print ("You have opted Business class and Calicut as place of departure")
tick.append("Business class")
amt=23040
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
22
print("Cabin baggage may not exceed 7 kilos")
print("PLEASE ENJOY FREE DINING AT OUR VIP LOUNGE")
elif (x==1 and p.lower()=="cochin" and age >=0 and age < 2 and tick[8].lower()=='oneway'):
print("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=23400*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="trivandrum" and age>=0 and age < 2 and
tick[8].lower()=='oneway'):
print("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=22800*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="kannur" and age >= 0 and age < 2 and tick[8].lower()=='oneway'):
print("You have opted for Business class and Kannur as place of departure")
tick.append("Business class")
amt=23100*(1/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="calicut" and age >= 0 and age < 2 and tick[8].lower()=='oneway'):
print("You have opted for Business class and Calicut as place of departure")
tick.append("Business class")
amt=23040*1/3
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="cochin" and age >=2 and age <= 10 and tick[8].lower()=='oneway'):
print("You have opted Business class and Cochin as place of departure")
tick.append("Business class")
amt=23400*(2/3)
print("TOTAL AMOUNT= Rs",amt)
23
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="trivandrum" and age >=2 and age <=10 and
tick[8].lower()=='oneway'):
print("You have opted Business class and Trivandrum as place of departure")
tick.append("Business class")
amt=22800*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="kannur" and age >=2 and age<=10 and tick[8].lower()=='oneway'):
print("You have opted for Business class and Kannur as place of departure")
tick.append("Business class")
amt=23100*(2/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==1 and p.lower()=="calicut" and age >=2 and age <=10 and tick[8].lower()=='oneway'):
print("You have opted for Business class and Calicut as place of departure")
tick.append("Business class")
amt=23040*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 32 kilos")
print("Cabin baggage may not exceed 7 kilos")
elif (x==2 and p.lower()=="cochin" and age > 10 and tick[8].lower()=='oneway'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=18600
print("TOATL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >10 and tick[8].lower()=='oneway'):
print("You have opted Economy class and Trivandrum as place of departure")
tick .append("Economy class")
amt=18000
24
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each of piece of baaggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >10 and tick[8].lower()=='oneway'):
print("You have opted Economy class and Kannur as place of departure")
tick.append("Economy class")
amt=18300
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >10 and tick[8].lower()=='oneway'):
tick.append("Economy class")
print("You have opted Economy class and Calicut as place of departure")
amt=18240
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="cochin" and age >=0 and age < 2 and tick[8].lower()=='oneway'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=18600*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >= 0 and age <2 and
tick[8].lower()=='oneway'):
print("You have opted Economy class and Trivandrum as place of departure")
tick.append("Economy class")
amt=18000*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >=0 and age <2 and tick[8].lower()=='oneway'):
print("You have opted for Economy class and Kannur as place of departure")
tick.append("Economy class")
25
amt=18300*(1/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >=0 and age <2 and tick[8].lower()=='oneway'):
print("You have opted for Economy class and Calicut as place of departure")
tick.append("Economy class")
amt=18240*(1/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="cochin" and age >=2 and age <=10 and tick[8].lower()=='oneway'):
print("You have opted Economy class and Cochin as place of departure")
tick.append("Economy class")
amt=18600*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="trivandrum" and age >=2 and age <=10 and
tick[8].lower()=='oneway'):
print("You have opted Economy class and Trivandrum as place of departure")
tick.append("Economy class")
amt=18000*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="kannur" and age >= 2 and age <=10 and
tick[8].lower()=='oneway'):
print("You have opted for Economy class and Kannur as place of departure")
tick.append("Economy class")
amt=18300*(2/3)
print("TOATAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
elif (x==2 and p.lower()=="calicut" and age >=2 and age <=10 and tick[8].lower()=='oneway'):
26
print("You have opted for Economy class and Calicut as place of departure")
tick.append("Economy class")
amt=18240*(2/3)
print("TOTAL AMOUNT= Rs",amt)
tick.append(amt)
print("Each piece of baggage may not exceed 23 kilos")
print("Cabin baggage may not exceed 5 kilos")
else:
print("INVALID CHOICE")
print()
print("\t This is a NON SMOKING FLIGHT \t ")
print("\t KINDLY FOLLOW ALL THE COVID-19 PROTOCOLS \t ")
print()
def menu():
print("Type 1 to view Breakfast options")
print("Type 2 to view Lunch options")
print("Type 3 to view Dinner options")
print("Type 4 to view Snacks")
print("Type 5 to view Special Meals")
print("Type 6 to view Beverages")
print("Type 7 to view Kid's meal")
print("Type 8 to view Baby food")
print()
x=int(input("Enter your choice : "))
cab=tick[11]
print()
if x==1:
print(" \t BREAKFAST MENU")
sql="select * from breakfast"
cur.execute(sql)
rows=cur.fetchall()
for a in rows:
print(a)
print()
elif x==2:
print(" \t LUNCH MENU")
sql="select * from lunch"
cur.execute(sql)
rows=cur.fetchall()
for b in rows:
27
print(b)
print()
elif x==3:
print(" \t DINNER MENU")
sql="select * from dinner"
cur.execute(sql)
rows=cur.fetchall()
for c in rows:
print(c)
print()
elif x==4:
print(" \t SNACKS MENU")
sql="select * from snacks"
cur.execute(sql)
rows=cur.fetchall()
for d in rows:
print(d)
print()
elif x==5 and cab.lower()=='business class':
print(" \t SPECIAL MEALS")
print("Starters")
sql="select * from spcl_start"
cur.execute(sql)
rows=cur.fetchall()
for e in rows:
print(e)
print()
print("Mains")
sql="select * from spcl_mains"
cur.execute(sql)
rows=cur.fetchall()
for f in rows:
print(f)
print()
print("Desserts")
sql="select * from desserts"
cur.execute(sql)
rows=cur.fetchall()
for g in rows:
print(g)
28
print()
elif x==6:
print("\t BEVERAGES ")
print("\1. Water")
sql="select * from bev_wat"
cur.execute(sql)
rows=cur.fetchall()
for h in rows:
print(h)
print()
print(" 2. Juices")
sql="select * from bev_juice"
cur.execute(sql)
rows=cur.fetchall()
for i in rows:
print(i)
print()
print(" 3. Soft drinks")
sql="select * from bev_sft"
cur.execute(sql)
rows=cur.fetchall()
for j in rows:
print(j)
print()
print(" 4. Coffee")
sql="select * from bev_coff"
cur.execute(sql)
rows=cur.fetchall()
for k in rows:
print(k)
print()
print(" 5. Tea")
sql="select * from bev_tea"
cur.execute(sql)
rows=cur.fetchall()
for l in rows:
print(l)
print()
elif x==7:
print("\t KID'S MEAL")
29
sql="select * from kid_meal"
cur.execute(sql)
rows=cur.fetchall()
for m in rows:
print(m)
print()
elif x==8:
print("\t BABY FOOD")
sql="select * from baby_food"
cur.execute(sql)
rows=cur.fetchall()
for o in rows:
print(o)
print()
else:
print("INVALID CHOICE")
print("SPECIAL MEALS ARE EXCLUSIVELY FOR BUSINESS CLASS PASSENGERS")
def ticket():
if tick[8].lower()=='oneway' or tick[8].lower()=='return':
print("\t \t \t MANN AIRLINES")
print("\t \t \t TICKET")
print("\t Name of passenger :",tick[0] , tick[1],tick[2])
print("\t Age :",tick[4])
if tick[5]=='yes':
print("\t Adult :",tick[5])
else:
print("\t Crib :",tick[6])
print("\t Date of jouney :",tick[7])
print("\t Time of departure : 02:30 am")
print("\t Time of arrival : 06.30 am (Kuwait time)")
print("\t Type of journey :",tick[8])
print("\t Place of departure:",tick[10],"International Airport")
print("\t Place of arrival : Kuwait International Airport")
print("\t Cabin :",tick[11])
print("\t Total amount : Rs",tick[12])
print()
print()
print()
print("Kindly report 2 and half hours before departure")
print()
30
if tick[8].lower()=='return':
print("\t \t \t MANN AIRLINES")
print("\t \t \t TICKET")
print("\t Name of passenger :",tick[0] , tick[1],tick[2])
print("\t Age :",tick[4])
if tick[5]=='yes':
print("\t Adult :",tick[5])
else:
print("\t Crib :",tick[6])
print("\t Date of jouney :",tick[9])
print("\t Time of departure : 11.00 pm (Kuwait time)")
print("\t Time of arrival : 06.30 am (IST)")
print("\t Place of arrival :",tick[10],"International Airport")
print("\t Place of departure: Kuwait International Airport")
print("\t Cabin :",tick[11])
print("\t Total amount : Rs",tick[12])
print()
print()
print("Kindly report 2 and half hours before departure")
print()
tick.clear()
def cancel():
name=input("Enter your first name:")
sql="delete from p_dta where cust_first_nme='%s'" % (name)
cur.execute(sql)
con.commit()
print("TICKET CANCELLED")
while True:
print("WELCOME TO MANN AIRLINES")
print()
print("Enter 1 : To enter customer data")
print("Enter 2 : To view cabins")
print("Enter 3 : To view ticketamount")
print("Enter 4 : To view menu")
print("Enter 5 : To view ticket")
print("Enter 6 : To cancel ticket")
print("Enter 7 : To exit")
print()
ch=int(input("Enter your choice:"))
print()
31
''' try: #ch=int(input("please select an above option:"))
except ValueError:
exit("\n hi thats not a number")'''
if(ch==1):
cust_register()
elif(ch==2):
view_cabin()
elif(ch==3):
ticketprice()
elif(ch==4):
menu()
elif(ch==5):
ticket()
elif(ch==6):
cancel()
elif(ch==7):
tick.clear()
break
else:
print("INVALID CHOICE")
h=input("\n DO YOU WANT TO CONTINUE(y/n): ")
print()
if h.lower()=='y':
continue
else:
print("THANK YOU FOR USING MANN AIRLINES")
tick.clear()
sys.exit()
else:
print("THANK YOU FOR USING MANN AIRLINES")
tick.clear()
sys.exit()
32

SAMPLE
OUTPUT
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

SQL SOURCE CODE:


49
50
51
52

Conclusion:

This project is a practical implementation of PYTHON-MySQL connectivity.


Python is a portable, flexible, modifiable and easy language. It is arguably more
efficient and faster compared to other languages. SQL (Structured Query Language)
is a standard language for accessing and manipulating databases. The interface
between PYTHON and MySQL is really helpful in designing real life applications. It
helps in designing programs which are useful for the common men.
Our project provides a platform for the reservation of airline tickets. Required details
are received from the client and ticket is booked accordingly. It is an efficient
platform for the easy booking of flight tickets. It is very helpful for passengers as they
are able to reserve tickets from any corner of the world easily.
We believe that we had made use of best of our knowledge to make this project. The
program was run and is compiled and rectified of all the errors. Finally the desired
output was obtained. There may be limitations in our project, but we look forward to
create more effective ones in the future. We firmly believe that this project is a
creative and successful one.
53

Bibliography
• Computer Science with PYTHON - Preeti Arora
• www.slideshare.net
• www.goindigo.in
• www.cs4school.com

You might also like