shruti computer science project
shruti computer science project
CLASS- XII
STREAM- SCIENCE
SUBJECT- COMPUTER SCIENCE(083)
REGISTRATION NO.- E221301180044
BOARD ROLL NO.-
TOPIC- AIRLINE RESERVATION
NERUL, NAVI MUMBAI
CERTIFICATE
This is to certify that this computer project ”Airline reservation” has been
completed by ‘Ms Shruti Punjabi’ of class XII Science in partial fulfillment
of the curriculum of the Central Board of Secondary Education leading to
the award of All India Senior School Certificate for the year 2020-21.
Registration No. :
Board Roll No:
__________________ __________________
Date: Date:
__________________ ___________________
Date:
DECLARATION
I hereby declare that the project
entitled “Airline reservation”
submitted to “Tilak public school” for
subject “computer science” under the
guidance of “Mrs Amrita Dutta” is a
record of original work done by us and
there is no copy or project related to it
has been submitted to any other
educational institution by us.
ACKNOWLEDGEMENT
I would like to express my special thanks of
gratitude to my teacher “ 'Mrs.Amrita' ” as
well as our principal “ Mrs.Prabhavathy
Ajith Kumar ” who gave me the golden
opportunity to do this wonderful project on
the topic
“ Airline reservation ” .
2. Easy to use
3. Client/server architecture
4. Free to download
5. It is scalable
6. High performance
7. High flexibility
8. Memory Efficiency
Code:-
import mysql.connector
mycon= mysql.connector.connect(user=’root’ ,
password=’password’, host=’localhost’)
Introduction to project
Online Airline Reservation System is a web
application that helps the commuters to book
flight tickets online.
In order to book the tickets, the commuter
has to either sign in if he/she is already a
member or register themselves in order to
book flights.
While booking, the user has to select the
type of airlines he/she will be travelling. This
can be done by viewing the flights and
choosing the one through which they want to
be travelled.
He/she has to fill up the details of their
reservation in the reservation option. A
message box will appear after the reservation is
successful.
Payment option will open up to pay the
ticket fare via online transaction(credit cards)
The System will provide notice related to flight
to the passengers through their provided mail
and phone number.
If in case commuters want to cancel their
reservation it can be done through the cancel
reservation option. A message box will appear
of cancel reservation being successful and
payment will be refundable.
Advantages
1. User gets notice regarding flight
which will help him during booking.
2. User can select the type of airlines he
wants to travel.
3. User can wherever and whenever
book and cancel the reservations.
4. User can easily login and register
without any notices and complications
Flow chart
Start
no yes
Sign in
reservation payment
Sucessful
End Reserve
File structures
Modules used.
1.Tkinter module- Tkinter is the standard GUI library for
python. Python when combined with tkinter provides a
fast and easy way to create GUI applications. Tkinter
provides a powerful object oriented interface to the TK
GUI toolkit
2.Mysql connector- It is used to connect python to mysql
where python act as frontend and sql as backend.
3. PIL –python imaging library is a free and open source
additional library for the python programming that adds
support for opening ,manipulating and saving many
different image file formats.
List of Functions
FUNCTIONS USES OF FUNCTIONS
def main1():
main1
def newuser1():
newuser1
def delete():
delete
def View1():
View1
def booking1():
booking1
root = Tk()
root.title("Airline")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
# Add your own database name and password here to reflect in the code
mypass = "abcdef"
mydatabase="library"
con
=pymysql.connect(host="localhost",user="root",password="root",database="project")
con1=
pymysql.connect(host="localhost",user="root",password="root",database="project1")
con2 =
pymysql.connect(host="localhost",user="root",password="root",database="project2")
con3 =
pymysql.connect(host="localhost",user="root",password="root",database="project3")
cur = con.cursor()
cur1 = con1.cursor()
cur2 = con2.cursor()
cur3 = con3.cursor()
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
newImageSizeWidth = int(imageSizeWidth*n)
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.2,rely=0.1,relwidth=0.6,relheight=0.16)
btn1.place(relx=0.28,rely=0.3 , relwidth=0.45,relheight=0.1)
btn2.place(relx=0.28,rely=0.4, relwidth=0.45,relheight=0.1)
btn3.place(relx=0.28,rely=0.5, relwidth=0.45,relheight=0.1)
btn4.place(relx=0.28,rely=0.6, relwidth=0.45,relheight=0.1)
btn5.place(relx=0.28,rely=0.7, relwidth=0.45,relheight=0.1)
root.mainloop()
2.sign in code
from tkinter import *
# Add your own database name and password here to reflect in the code
#mypass = "abcdef"
#mydatabase="library"
con =
pymysql.connect(host="localhost",user="root",password="root",database="project")
cur = con.cursor()
def checksignin():
uname = userName.get()
pwd = password.get()
cur.execute(signinSql)
count=cur.rowcount
if count>0:
root.destroy()
library()
else:
messagebox.showinfo('Failure',"Please check User Name and Password")
root = Tk()
root.title("Sign in")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
newImageSizeWidth = int(imageSizeWidth*n)
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.35,rely=0.1,relwidth=0.2,relheight=0.10)
headingLabel = Label(headingFrame1, text="SIGN IN", bg='indian red', fg='black',
font=('Gabriola',15,"bold"))
labelFrame.place(relx=0.2,rely=0.5,relwidth=0.5,relheight=0.3)
lb1.place(relx=0.05,rely=0.2, relheight=0.08)
userName = Entry(labelFrame)
lb2.place(relx=0.05,rely=0.35, relheight=0.08)
password = Entry(labelFrame)
#Submit Button
SubmitBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
3.Add new user code
from tkinter import *
def newuser():
Fname = userInfo1.get()
Lname = userInfo2.get()
ContactNo = userInfo3.get()
Address= userInfo4.get()
Dob = userInfo5.get()
Email= userInfo6.get
#Email = Email.lower()
try:
cur.execute(insertuser)
con.commit()
except:
print(Fname)
print(Lname)
print(ContactNo)
print(Address)
print(Dob)
print(Email)
root.destroy()
#def adduser():
#global
userInfo1,userInfo2,userInfo3,userInfo4,userInfo5,userInfo6,Canvas1,con,cur,newuserTabl
e,root
root = Tk()
root.title("Airline")
root.minsize(width=400,height=400)
root.geometry("600x500")
#mypass = "root"
#mydatabase="project1"
con =
pymysql.connect(host="localhost",user="root",password="root",database="project1")
cur = con.cursor()
#Canvas1 = Canvas(root)
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
Canvas1 = Canvas(root)
Canvas1.config(bg="#ff6e40")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1 = Frame(root,bg="#FFBB00",bd=5)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame = Frame(root,bg='black')
labelFrame.place(relx=0.1,rely=0.4,relwidth=0.8,relheight=0.5)
# Fname
lb1.place(relx=0.05,rely=0.2, relheight=0.06)
userInfo1 = Entry(labelFrame)
# Lname
lb2.place(relx=0.05,rely=0.35, relheight=0.06)
userInfo2 = Entry(labelFrame)
# ContactNo
lb3.place(relx=0.05,rely=0.50, relheight=0.06)
userInfo3 = Entry(labelFrame)
# Address
lb4.place(relx=0.05,rely=0.65, relheight=0.06)
userInfo4 = Entry(labelFrame)
# Dob
lb5.place(relx=0.05,rely=0.80, relheight=0.06)
userInfo5 = Entry(labelFrame)
lb6.place(relx=0.05,rely=0.95, relheight=0.04)
userInfo6 = Entry(labelFrame)
#Submit Button
SubmitBtn.place(relx=0.28,rely=0.95, relwidth=0.18,relheight=0.04)
quitBtn.place(relx=0.53,rely=0.95, relwidth=0.18,relheight=0.04)
root.mainloop()
# Add your own database name and password here to reflect in the code
con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")
cur = con.cursor()
#reservationTable = "reservation"
#def View():
root = Tk()
root.title("reservation")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
newImageSizeWidth = int(imageSizeWidth*n)
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
Canvas1 = Canvas(root)
Canvas1.config(bg="#12a4d9")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)
y = 0.25
Label(labelFrame, text="%-30s%-40s%-30s%-30s%-30s%-
40s"%('boarding','destination','day','time','fare','class'),bg='misty
rose4',fg='white',font=('Gabriola',15,"bold")).place(relx=0.07,rely=0.1)
Label(labelFrame, text="--------------------------------------------------------------------------------------
----------------------------------------------------------------------",bg='misty
rose4',fg='black').place(relx=0.05,rely=0.2)
try:
#print(cur.fetchall())
for i in cur:
Label(labelFrame, text="%-30s%-40s%-30s%-30s%-30s%-
40s"%(i[0],i[1],i[2],i[3],i[4],i[5]),bg='misty
rose4',fg='white',font=('Gabriola',15,"bold")).place(relx=0.07,rely=y)
y+=0.1
cur.fetchone()
except:
quitBtn = Button(root,text="Back",bg='indian
red',bd=10,fg='black',font=('Gabriola',13,"bold"),relief=RAISED, command=root.destroy)
quitBtn.place(relx=0.4,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
5.reservation code
from tkinter import*
con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")
cur = con.cursor()
BookingTable = "booking"
def booking():
global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,inf6,quitBtn,root,Canvas1
boarding = inf1.get()
destination = inf2.get()
day=inf3.get()
time=inf4.get()
fare=inf5.get()
Class=inf6.get()
issueBtn.destroy()
labelFrame.destroy()
lb1.destroy()
inf1.destroy()
inf2.destroy()
inf3.destroy()
inf4.destroy()
inf5.destroy()
inf6.destroy()
#cur.execute(updateStatus)
con.commit()
messagebox.showinfo('success',"welcome to airlines" )
root.destroy()#BookingTable = "booking"
root = Tk()
root.title("booking")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
newImageSizeWidth = int(imageSizeWidth*n)
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
Canvas1 = Canvas(root)
Canvas1.config(bg="#D6ED17")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)
# Book ID
lb1.place(relx=0.05,rely=0.2)
inf1 = Entry(labelFrame)
inf1.place(relx=0.3,rely=0.2, relwidth=0.62)
lb2.place(relx=0.05,rely=0.3)
inf2 = Entry(labelFrame)
inf2.place(relx=0.3,rely=0.3, relwidth=0.62
# Issued To Student name
lb3.place(relx=0.05,rely=0.4)
inf3 = Entry(labelFrame)
inf3.place(relx=0.3,rely=0.4, relwidth=0.62)
lb4.place(relx=0.05,rely=0.5)
inf4 = Entry(labelFrame)
inf4.place(relx=0.3,rely=0.5, relwidth=0.62)
lb5.place(relx=0.05,rely=0.6)
inf5 = Entry(labelFrame)
inf5.place(relx=0.3,rely=0.6, relwidth=0.62)
lb6.place(relx=0.05,rely=0.7)
inf6 = Entry(labelFrame)
inf6.place(relx=0.3,rely=0.7, relwidth=0.62)
#Issue Button
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
6.payment code
from tkinter import*
con =
pymysql.connect(host="localhost",user="root",password="root",database="project1")
cur = con.cursor()
paymentTable = "payment"
def payment():
global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,quitBtn,root,Canvas1
code = inf1.get()
cvv = inf2.get()
expiry_date=inf3.get()
password=inf4.get()
fare=inf5.get()
#Class=inf6.get()
issueBtn.destroy()
labelFrame.destroy()
lb1.destroy()
inf1.destroy()
inf2.destroy()
inf3.destroy()
inf4.destroy()
inf5.destroy()
#inf6.destroy()
#cur.execute(updateStatus)
con.commit()
messagebox.showinfo('success',"payment successful" )
root.destroy()
#BookingTable = "payment"
root = Tk()
root.title("payment")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
Canvas1 = Canvas(root)
Canvas1.config(bg="#D6ED17")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame.place(relx=0.25,rely=0.3,relwidth=0.5,relheight=0.4)
# code
lb1.place(relx=0.05,rely=0.1)
inf1 = Entry(labelFrame)
inf1.place(relx=0.15,rely=0.2, relwidth=0.25)
lb2.place(relx=0.65,rely=0.15)
inf2 = Entry(labelFrame)
inf2.place(relx=0.75,rely=0.2, relwidth=0.09)
lb3.place(relx=0.05,rely=0.39)
inf3 = Entry(labelFrame)
inf3.place(relx=0.25,rely=0.45, relwidth=0.12)
lb4.place(relx=0.65,rely=0.39)
inf4 = Entry(labelFrame)
inf4.place(relx=0.8,rely=0.45, relwidth=0.09)
lb5.place(relx=0.05,rely=0.6)
inf5 = Entry(labelFrame)
inf5.place(relx=0.2,rely=0.65, relwidth=0.09)
#lb6.place(relx=0.05,rely=0.7)
#inf6 = Entry(labelFrame)
#inf6.place(relx=0.3,rely=0.7, relwidth=0.62)
#Issue Button
issueBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")
cur = con.cursor()
BookingTable = "booking"
def booking():
global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,inf6,quitBtn,root,Canvas1
boarding = inf1.get()
destination = inf2.get()
day=inf3.get()
time=inf4.get()
fare=inf5.get()
Class=inf6.get()
issueBtn.destroy()
labelFrame.destroy()
lb1.destroy()
inf1.destroy()
inf2.destroy()
inf3.destroy()
inf4.destroy()
inf5.destroy()
inf6.destroy()
#cur.execute(updateStatus)
con.commit()
root.destroy()
#BookingTable = "booking"
root = Tk()
root.title("booking")
root.minsize(width=400,height=400)
root.geometry("2880x1800")
# Take n greater than 0.25 and less than 5
same=True
n=0.5
background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")
newImageSizeWidth = int(imageSizeWidth*n)
if same:
newImageSizeHeight = int(imageSizeHeight*n)
else:
newImageSizeHeight = int(imageSizeHeight/n)
background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)
img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)
Canvas1.pack(expand=True,fill=BOTH)
Canvas1 = Canvas(root)
Canvas1.config(bg="#D6ED17")
Canvas1.pack(expand=True,fill=BOTH)
headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)
labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)
# Book ID
lb1.place(relx=0.05,rely=0.2)
inf1 = Entry(labelFrame)
inf1.place(relx=0.3,rely=0.2, relwidth=0.62)
lb2.place(relx=0.05,rely=0.3)
inf2 = Entry(labelFrame)
inf2.place(relx=0.3,rely=0.3, relwidth=0.62)
lb3.place(relx=0.05,rely=0.4)
inf3 = Entry(labelFrame)
inf3.place(relx=0.3,rely=0.4, relwidth=0.62)
lb4.place(relx=0.05,rely=0.5)
inf4 = Entry(labelFrame)
inf4.place(relx=0.3,rely=0.5, relwidth=0.62)
lb5.place(relx=0.05,rely=0.6)
inf5 = Entry(labelFrame)
inf5.place(relx=0.3,rely=0.6, relwidth=0.62)
lb6.place(relx=0.05,rely=0.7)
inf6 = Entry(labelFrame)
inf6.place(relx=0.3,rely=0.7, relwidth=0.62)
#Issue Button
issueBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)
quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)
root.mainloop()
sql coding
add new user
use project1; create table newuser (Fname varchar(40) NOT NULL, Lname varchar(40)
NOT NULL, ContactNo int Primary key, Address varchar(40), Dob char(10),Emailchar(15));
select * from newuser;
2.sign in
3.Add new user
4.cancel reservation
5.view flights
6. Reservation
8. Payment
mySql output:-
1. Sign in
2. New user
3. Reservation
4. payment
LIMITATIONS AND IMPROVEMENTS
The Existing system includes problems like lack of time
consuming, accuracy, high cost, security problems, etc.
There are many problems in existing systems like:
● Manpower
● High cost
● Time and speed
● Security
● Complexity
● Maintenance
● Accuracy
● Storing
● Records might got lost or be insufficient due to
manual errors.
● Maintaining and managing data is very costly and
time consuming, because there are many documents
that have to be maintained by each branch and
copies have to be transferred to relative branches.
● Transfer of information within the branches is costly
and time consuming.
Conclusion
This system is user friendly and accurate.
>This system is efficient in reservation.
>It has no hidden cost.
>It enables customer to check availability of
the flights online, buy airplane tickets and pay
for them online.
>This makes it easier for the customer to get
the flight tickets online instead of accessing
them from some other sources.
Bibliography
-www.wikipedia.com
-www.scribd.com
-computersciencearticle.in
-www.tutorialspoint.com
-www.quora.com
-Sumita arora textbook -XI & Xll