Flight Booking System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

INDEX

S.No. Contents Page No.

1. INTRODUCTION
2

2. MANUAL SYSTEM 9

3. PROPOSED SYSTEM 10

4. INTRODUCTION OF THE PROJECT 11

5. MODULE USED IN THIS PROJECT 13

6. DESIGN WORK
14

7. SYSTEM DEVELOPMENT
15
LIFE CYCLE[SDLC]
8. SOURCE CODE
21

9. OUTPUT(SCREENSHOT) 37

10. SYSTEM TESTING & MAINTENANCE


42

11. CONCLUSION 43

12. BIBLIOGRAPHY
44
INTRODUCTION TO PYTHON
Python is an interpreter, object-oriented, high-level programming language with
dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding; make it very attractive for Rapid Application
Development, as well as for use as a scripting language to connect existing
components together. Python's simple and easy to learn syntax emphasizes
readability and therefore reduces the cost of program maintenance. Python
supports modules and packages, which encourages program modularity and code
reuse. The Python interpreter and the extensive standard library are available in
source or binary form without charge for all major platforms, and can be freely
distributed.

➢ Easy to code: Python is a high-level programming language and it is very easy to


code. It is also a developer-friendly language.

➢ Free and Open Source: Python is freely available. You can download it from the
Python Official Website. Secondly, it is open-source. This means that its source
code is available to the public. You can download it, change it, use it, and distribute
it.

➢ Object-Oriented Language: One of the key features of python is Object-


Oriented programming. Python supports object-oriented language and concepts of
classes, objects, modularization etc.

➢ GUI Programming Support: Graphical User interfaces can be made using a


module such as PyQt5, PyQt4, wxPython, or Tk in python.

➢ High-Level Language: Python is a high-level language. When we write


programs in python, we do not need to remember the system architecture, nordo
we need to manage the memory.

➢ Extensible feature: If needed, you can write some of your Python code in other
languages like C++. This makes Python an extensible language, meaning that it can
be extended to other languages.

➢ Python is Portable language: Python language is also a portable language. For


example, if we have python code for windows and if we want to run this code on
other platforms such as Linux, Unix and Mac then we do not need to change it,
we can run this code on any platform.
➢ Python is Integrated language: Python is also an Integrated language because
we can easily integrated python with other languages like C,C++, etc.

➢ Interpreted Language: Python is an Interpreted Language because Python code


is executed line by line at a time. Like other languages C, C++, Java, etc. there is no
need to compile entire python code, this makes it easier to debug the code.

➢ Large Standard Library: Python has a large standard library which provides a
rich set of module and functions so you do not have to write your own code for
every single thing. There are many libraries present in python for such as regular
expressions, web browsers, etc.

➢ Dynamically Typed Language: Python is dynamically-typed. This means that the


type for a value is decided at runtime, not in advance. This is why we don’t need to
specify the type of data while declaring it.
INTRODUCTION TO MYSQL
A database is a collection of information related to a particular subject or
purpose, such as tracking customer orders or maintaining a product collection.
Using any RDBMS application software like MS SQL Server, MySQL, Oracle,
Sybase etc., and all information can be managed from a single database file.
Within the file, data can be divided into separate storage containers called
tables. Data can be retrieved using queries.
A table is a collection of data about a specific topic, such as products or suppliers.
Using a separate table for each topic means you can store that data only once,
which makes your database more efficient and reduces data-entry errors. Table
organizes data into columns (called fields) and rows (called records).
A Primary key is one or more fields whose value or values uniquely identify
each record in a table. In a relationship, a primary key is used to refer tospecific
record in one table from another table. A foreign key is a column in a relational
database table that provides a link between data in two tables. It acts as a cross
reference between tables because it references the primary key of another table,
thereby establishing a link between them.

Role of RDBMS Application Program:


A computer database works as a electronic filing system, which has a large
number of ways of cross referencing, and this allows the user many different
ways in which to re-organize and retrieve data. A database can handle business
inventory, accounting and filing and use the information in its files to prepare
summaries, estimates and other reports. The management of data in a database
system is done by means of a general-purpose software package called a
Database Management System (DBMS). Some commercially available DBMS are
MS SQL Server, MS ACCESS, INGRES, ORACLE, and Sybase. A database
management system, therefore, is a combination of hardware and software that
can be used to set up and monitor a database, and can manage the updating and
retrieval of database that has been stored in it. Most of the database
management systems have the following capabilities:
♦ creating of a table, addition, deletion, modification of records.
♦ Retrieving data collectively or selectively.
♦ The data stored can be sorted or indexed at the user's discretion and
direction.
♦ Various reports can be produced from the system. These may be either
standardized report or that may be specifically generated according to specific
user definition.
♦ Mathematical functions can be performed and the data stored in the
database can be manipulated with these functions to perform the desired
calculations.
The management of data in a database system is done by means of a general-
purpose software package called a Database Management System (DBMS).
Some commercially available RDBMS are MS SQL Server, MS ACCESS, INGRES,
ORACLE, and Sybase.

The Main Features of MySQL


➢ MySQL is written in C and C++.
➢ Easy to use: MySQL is easy to use. We have to get only the basic knowledge
of SQL. We can build and interact with MySQL by using only a few simple SQL
statements.
➢ Secure: It consists of a solid data security layer that protects sensitive data
from intruders. Also, passwords are encrypted in MySQL.
➢ Client/Server Architecture: It follows the working of a client/server
architecture. There is a database server (MySQL) and arbitrarily many clients
(application programs), which communicate with the server; that is, they can
query data, save changes, etc.
➢ Free to download: It is free to use so that we can download it from MySQL
official website without any cost.
➢ Speed: It is considered to be one of the very fast database languages, backed
by a large number of the benchmark test.
➢ High Flexibility: It supports a large number of embedded applications, which
makes it very flexible.
➢ Compatible on many operating systems: It is compatible to run on many
operating systems, like Novell NetWare, Windows, Linux, many varieties of UNIX
etc.
➢ Allows roll-back: It allows transactions to be rolled back, commit, and crash
recovery.
➢ Memory efficiency: It’s efficiency is high because it has a very low memory
leakage problem.
➢ High Performance: It is faster, more reliable, and cheaper because of its
unique storage engine architecture. It provides very high-performance results in
comparison to other databases without losing an essential functionality of the
software. It has fast loading utilities because of the different cache memory.
➢ High Productivity: MySQL uses Triggers, Stored procedures, and views that
allow the developer to give higher productivity.
➢ Platform Independent: It can be downloaded, installed, and executed on
most of the available operating systems.
➢ Supports large databases: MySQL Server can be used with databases that
contain 50 million records. There are users who use MySQL Server with 200,000
tables and about 50,000,000 rows.
MANUAL SYSTEM
Manual system means a system which does it’s work itself not by help of any
technology in which paper work has some special place.

All conventional methods are in more use instead of new technologies. And now as
everybody knows that computer graphs at its extent means the more you can use
computer system the more you can make your work easier.

And if in this case system is not computerized then it has to face a lot of problems
because every task gets complex and time consumable.

1. Costly
2. Difficulty in searching the records
3. Maintenance Problem
4. Time consuming
5. Tedious
PROPOSED SYSTEM
Proposed system is a system proposed which is computerized in every manner.
Computerized system is not just adding machines but they are capable of doing
much complex, tedious and cumbersome tasks.
Processing of data by hand is satisfactory only when the amount of data to be
processed is small and also the manual processing is slow, monotonous & often
subject to error.
Above explanation is clearly telling us that existing system contains a lot of
deficiencies which can be removed by only by following proposed system .
Now a days, computer graph is at its extent. Computerization contains a lot of
benefits so that everyone chasing and following computerized items. Now,
question arises what kind of help this project or computerized system can give
to remove all disadvantages of this existing system.
INTRODUCTION TO OUR PROJECT
Introduction to Flight Booking Systems
Flight Booking Systems play a pivotal role in modern travel, offering travelers a
convenient and efficient way to plan and manage their journeys by air. These systems
have revolutionized the way people book flights, making it easier and more accessible
than ever before.

Key Uses of Flight Booking Systems

Flight Booking Systems serve several essential purposes:

1. Flight Search: Users can search for flights based on their departure and destination
cities, travel dates, and preferences. This allows travelers to explore various flight
options and find the most suitable ones.

2. Booking Flights: Once users have found their desired flights, they can proceed to
book their tickets. Flight Booking Systems facilitate the booking process, ensuring
travelers secure their seats with ease.

3. Seat Selection: Many systems offer the option to choose specific seats, allowing
passengers to customize their flying experience according to their preferences.

4. Pricing and Fare Information: Travelers can view detailed fare information,
including base fares, taxes, fees, and any additional charges. This transparency helps
passengers make informed decisions.

5. Payment Processing: Flight Booking Systems provide secure payment processing,


enabling travelers to pay for their bookings using various payment methods, such as
credit cards, debit cards, and digital wallets.

6. Itinerary Management: Once a booking is confirmed, users receive a detailed


itinerary that includes flight details, departure times, and other essential information.
This simplifies travel planning and ensures passengers are well-prepared for their
journeys.

7. Real-Time Updates: Travelers can receive real-time updates on their flights,


including delays, gate changes, and other crucial information. This helps passengers
stay informed and adapt to any changes in their travel plans.

8. Accessibility: Flight Booking Systems are accessible through various platforms,


including websites, mobile apps, and travel agencies, making it convenient for
travelers to book flights from anywhere, at any time.

9. Comparison Shopping: These systems often provide features that allow users to
compare fares, routes, and airlines, helping them find the best deals and value for
their money.

10. Traveler Profiles: Some systems offer the option to create traveler profiles,
which can store personal information and travel preferences for quicker and more
efficient bookings in the future.

Flight Booking Systems have become an integral part of modern travel, simplifying
the process of planning and booking flights for millions of travelers worldwide.
Whether you're a frequent flyer or planning a one-time journey, these systems are
designed to make your travel experience more convenient and enjoyable.
MODULES USED IN PROJECT
1. mysqlconnector:

We can connect mysql and python using this module. Add record in mysql using this
module.

2. Random Module:
Python's random module provides functions for generating random numbers and
data, making it useful for tasks like simulations, games, and randomization.

3. Sys Module:
The sys module in Python provides access to system-specific parameters and
functions,
allowing you to interact with the Python runtime environment and command-line
arguments.

4. Tabulate Module:
Tabulate is a Python library that simplifies the creation of formatted tables from data
structures like lists and dictionaries, making it handy for data presentation and tabular
data manipulation.
DESIGN WORK – MIND MAP

Add Flight

Search and book


flights

Payment Processing

Ticket generation

User Authentication

Error handling
SYSTEM DEVELOPMENT CYCLE – SDLC
Every computer-based system has a life cycle. System development starts when
management or sometimes system development personnel feel that a new system or
an improvement in the existing system is required. The system development life cycle
is classically thought of as the
set of activities that analysis, designers and user carry to develop and implement an
information system.

Steps Follow in System Development Life Cycle is:

1. Preliminary Survey or Investigation.


2. Feasibility Study
3. System Analysis
4. Design of Software
5. Development of software
6. System Testing
7. Implementation and evaluation
8. Maintenance
Preliminary Survey

One of the most difficult tasks to the system analyst is identifying the real problem of
the existing system. Without clear understanding of the problem in the system, any
further work done will lead to
wastage of effort at a later stage.

In Preliminary Survey the analyst get information about different source and find out
what are the objective of designing the proposed system i.e. what are requirement of
designing of the new software . In this we identified what are the problems in current
system to find out the drawback of current system and find out what are the best
system that full the requirement of the a particular Business Enterprises .

Feasibility Study

In this step we examine the feasibility of the proposed system. This involves the costs
and benefits of the system. Initially a rough cost benefit analysis will be sufficient for
the top management to take a decision either in favor of or against the proposed
system.

System design

When the system analyst decides that the requested system is feasible and the
management agrees to continue the development process, the next phase of SDLC is
determination of system requirements. This phase includes studying of existing
system in details and collecting data in order to find out the requirement of the users.

Implementation

In implementation, the designs are translated in to code. Computer programs are


written using a conventional programming language or an application generator.
Programming tools like compilers, interpreters, debuggers are used to generate the
code. Different high level languages like python, C, C++, Pascal, Java are used for
coding.
PICTORIAL REPRESENTATION OF SDLC

Planning phase
The planning phase is the most critical step in completing development, acquisition,
and maintenance projects. Careful planning, particularly in the early stages of a
project, is necessary to coordinate activities and manage project risks effectively. The
depth and formality of project plans should be commensurate with the characteristics
and risks of a given project. Project plans refine the information gathered during the
initiation phase by further identifying the specific activities and resources required to
complete a project.
A critical part of a project manager’s job is to coordinate discussions between user,
audit, security, design, development, and network personnel to identify and
document as many functional, security, and network requirements as possible. During
this phase, a plan is developed that documents the approach to be used and includes
a discussion of methods, tools, tasks, resources, project schedules, and user input. A
Project Management Plan is created with components related to acquisition planning,
configuration management planning, quality assurance planning, concept of
operation.

Requirement analysis phrase


This phase formally defines the detailed functional user requirements using high-level
requirements identified in the Initiation, System Concept, and Planning phases. It also
delineates the requirements in terms of data, system performance, security, and
maintainability requirements for the system. The requirements are defined in this
phase to a level of detail sufficient for systems design to proceed. They need to be
measurable, testable, and relate to the business need or opportunity identified in the
Initiation Phase.
The requirements that will be used to determine acceptance of the system are
captured in the Test and Evaluation Master Plan.

The purposes of this phase are to:


1. Further, define and refine the functional and data requirements and document
them in the Requirements Document.

2. Complete business process reengineering of the functions to be supported (i.e.,


verify what information drives the business process, what information is
generated, who generates it, where the information goes, and who processes
it).

3. Develop detailed data and process models (system inputs, outputs, and the
process.

4. Develop the test and evaluation requirements that will be used to determine
acceptables system performance.

Design phase
The design phase involves converting the informational, functional, and network
requirements identified during the initiation and planning phases into unified design
specifications that developers use to script programs during the development phase.
Program designs are constructed in various ways. Using a top-down approach,
designers first identify and link major program components and interfaces, then
expand design layouts as they identify and link smaller subsystems and connections.
Using a bottom-up approach, designers first identify and link minor program
components and interfaces, then expand design layouts as they identify and link larger
systems and connections. Contemporary design techniques often use prototyping
tools that build mock-up designs of items such as application screens, database
layouts, and system architectures . End users, designers, developers, database
managers, and network administrators should review and refine the prototyped
designs in an iterative process until they agree on an acceptable design. Audit,
security, and quality assurance personnel should be involved in the review and
approval process. During this phase, the system is designed to satisfy the functional
requirements identified in the previous phase.

➢ Developing a conversion plan to migrate current data to the new


system.
➢ Defining major subsystems and their inputs and outputs.
✓ Allocating processes to resources.
✓ Preparing detailed logic specifications for each software module. The result is a
draft System Design Document which captures the preliminary design for the
system.
✓ Everything requiring user input or approval is documented and reviewed by the
user. Once these documents have been approved by the Agency CIO and
Business Sponsor, the final System Design Document is created to serve as the
Critical/Detailed Design for the system.
✓ This document receives a rigorous review by Agency technical and functional
representatives to ensure that it satisfies the business requirements.
Concurrent with the development of the system design, the Agency Project
Manager begins development of the Implementation Plan, Operations and
Maintenance Manual, and the Training Plan.

Development phase
The development phase involves converting design specifications into executable
programs. Effective development standards include requirements that programmers
and other project participants discuss design specifications before programming
begins. The procedures help ensure programmers clearly understand program designs
and functional requirements. Programmers use various techniques to develop
computer programs. The large transaction-oriented programs associated with
financial institutions have traditionally been developed using procedural
programming techniques. Procedural programming involves the line-by-line
scripting of logical instructions that are combined to form a program. Effective
completion of the previous stages is a key factor in the success of the Development
phase. The Development phase consists of:
• Translating the detailed requirements and design into system
components.
• Testing individual elements (units) for usability.
• Preparing for integration and testing of the IT system.
• Testing as a deployed system with end users working together with contract
personnel

Implementation phase
This phase is initiated after the system has been tested and accepted by the user. In
this phase, the system is installed to support the intended business functions. System
performance is compared to performance objectives established during the planning
phase. Implementation includes user notification, user training, installation of
hardware, installation of software onto production computers, and integration of the
system into daily work processes. This phase continues until the system is operating
in production in accordance with the defined user requirements.

Operations and maintenance phase


The system operation is ongoing. The system is monitored for continued performance
in accordance with user requirements and needed system modifications are
incorporated. Operations continue as long as the system can be effectively adapted
to respond to the organization’s needs. When modifications or changes are identified,
the system may re-enter the planning phase.

The purpose of this phase is to:


♦ Operate, maintain, and enhance the system.
♦ Certify that the system can process sensitive information.
♦ Conduct periodic assessments of the system to ensure the functional requirements
continue to be satisfied.
♦ Determine when the system needs to be modernized, replaced, or retired.

Integration and test phase


Subsystem integration, system, security, and user acceptance testing is conducted
during the integration and test phase. The user, with those responsible for quality
assurance, validates that the functional requirements, as defined in the functional
requirements document, are satisfied by the developed or modified system. OIT
Security staff assesses the system security and issue a security certification and
accreditation prior to installation/implementation.
Multiple levels of testing are performed, including
• Testing at the development facility by the contractor and possibly supported by
end users.
SOURCE CODE
Source code
import mysql.connector as mys

import random

import sys

from tabulate import tabulate

# Define table headers

headers1 = ["FLIGHTNO", "FROM", "TO", "JOURNEY TIME", "FARE(IN INR)", "AIRLINE"]

headers2 = ["FLIGHTNO", "FROM", "TO", "JOURNEY TIME", "AIRLINE"]

headers3 = ["PASSENGER NO.", "PASSENGER NAME", "GENDER", "AGE", "SEAT"]

# Establish a database connection

mycon = mys.connect(host="localhost", user="root", passwd="root", database="projectfinal")

mycursor = mycon.cursor()

# Function to add flights to the database

def add_flight():

print("-------------------------------------------------------------------------------------------------------------------
--")

try:

flightno = int(input("ENTER THE FLIGHT NUMBER:"))

bcity = input("ENTER THE BOARDING CITY:")

dcity = input("ENTER THE DESTINATION CITY:")

jtime = input("ENTER THE JOURNEY TIME:")

fare = int(input("ENTER THE FARE OF THE FLIGHT:"))

airline = input("ENTER THE NAME OF THE AIRLINE:")


query = "INSERT INTO flightbook VALUES (%s, %s, %s, %s, %s, %s)"

values = (flightno, bcity, dcity, jtime, fare, airline)

mycursor.execute(query, values)

mycon.commit()

print("FLIGHT ADDED TO DATABASE")

print("----------------------------------------------------------------------------------------------------------------
-----")

except:

print("----------------------------------------------------------------------------------------------------------------
-----")

print(f"FLIGHT WITH FLIGHT NUMBER {flightno} ALREADY EXISTS IN DATABASE!!!")

print("----------------------------------------------------------------------------------------------------------------
-----")

ans1 = input("WANT TO ADD MORE FLIGHTS? (Y/N):")

if ans1.lower() == "y":

add_flight()

else:

start()

# Function for user login and signup

def login():

print("-------------------------------------------------------------------------------------------------------------------
--")

print("1 --> SIGN UP")

print("2 --> SIGN IN")

print()
n = int(input("CHOOSE FROM THE FOLLOWING OPTIONS (1 OR 2):"))

print("-------------------------------------------------------------------------------------------------------------------
--")

# Create the user_detail table if it doesn't exist

query = "CREATE TABLE IF NOT EXISTS user_detail (USERNAME VARCHAR(100),


EMAIL_ADDRESS VARCHAR(100) PRIMARY KEY, PASSWORD VARCHAR(20))"

mycursor.execute(query)

if n == 1:

uname = input("ENTER YOUR USERNAME:")

email = input("ENTER YOUR EMAIL:")

pword = input("ENTER YOUR PASSWORD:")

try:

query = "INSERT INTO user_detail VALUES (%s, %s, %s)"

values = (uname, email, pword)

mycursor.execute(query, values)

mycon.commit()

print("YOUR ACCOUNT HAS BEEN SUCCESSFULLY CREATED....")

print("-------------------------------------------------------------------------------------------------------------
--------")

except:
print()

print("THIS ACCOUNT ALREADY EXISTS!!!")

login()

elif n == 2:

email = input("ENTER YOUR EMAIL:")

pword = input("ENTER YOUR PASSWORD:")

query = "SELECT * FROM user_detail WHERE EMAIL_ADDRESS = %s AND PASSWORD = %s"

values = (email, pword)

mycursor.execute(query, values)

data = mycursor.fetchall()

nrec = mycursor.rowcount

if nrec != 0:

print()

print("LOGIN SUCCESSFUL...")

print("-------------------------------------------------------------------------------------------------------------
--------")

start()

else:

print()

print("LOGIN FAILED --> PLEASE ENTER THE CORRECT EMAIL AND PASSWORD")

login()
# Function to start the main menu

def start():

print("1 --> SEARCH FLIGHTS")

print("2 --> BOOK FLIGHTS")

print("3 --> ADD FLIGHTS TO THE DATABASE")

print("4 --> EXIT")

print()

n = int(input("CHOOSE FROM THE FOLLOWING OPTIONS (1, 2, 3, OR 4):"))

if n == 1:

search_flights()

elif n == 2:

book_flight()

elif n == 3:

add_flight()

elif n == 4:

sys.exit()

else:

print("Invalid choice. Please choose 1, 2, 3, or 4.")

# Function to search for flights

def search_flights():

print("-------------------------------------------------------------------------------------------------------------------
--")

a = input("ENTER YOUR BOARDING CITY:")


b = input("ENTER YOUR DESTINATION CITY:")

print()

query = "SELECT * FROM flightbook WHERE FROM_ = %s AND TO_ = %s"

values = (a, b)

mycursor.execute(query, values)

data = mycursor.fetchall()

nrec = mycursor.rowcount

list1 = []

if nrec != 0:

print(nrec, "FLIGHTS FOUND")

for i in data:

list1.append(i)

print(tabulate(list1, headers=headers1, tablefmt="grid"))

print("----------------------------------------------------------------------------------------------------------------
-----")

else:

print()

print("FLIGHTS NOT FOUND!!!")

print()

print("----------------------------------------------------------------------------------------------------------------
-----")

start()

# Function to book a flight


def book_flight():

print("-------------------------------------------------------------------------------------------------------------------
--")

a = input("ENTER YOUR BOARDING CITY:")

b = input("ENTER YOUR DESTINATION CITY:")

print()

query = "SELECT * FROM flightbook WHERE FROM_ = %s AND TO_ = %s"

values = (a, b)

mycursor.execute(query, values)

data = mycursor.fetchall()

nrec = mycursor.rowcount

list1 = []

if nrec != 0:

print(nrec, "FLIGHTS FOUND")

for i in data:

list1.append(i)

print(tabulate(list1, headers=headers1, tablefmt="grid"))

else:

print("FLIGHTS NOT FOUND...")

return

print()
print("PLEASE PROVIDE US THE FOLLOWING DETAILS OF THE FLIGHT YOU WANT TO BOOK")

fno = int(input("ENTER THE FLIGHT NO:"))

query = "SELECT * FROM flightbook WHERE FLIGHTNO = %s"

values = (fno,)

mycursor.execute(query, values)

data = mycursor.fetchone()

list3 = []

if data is not None:

list3.append(data)

print(tabulate(list3, headers=headers1, tablefmt="grid"))

print()

ans2 = input("ARE YOU SURE YOU WANT TO BOOK THIS FLIGHT? (Y/N):")

print()

if ans2.lower() == "y":

query = "DROP TABLE IF EXISTS passengers"

mycursor.execute(query)

query = "CREATE TABLE passengers (PASSENGERNO INT, PASSENGER_NAME


VARCHAR(100), GENDER VARCHAR(20), AGE INT, SEAT VARCHAR(20))"

mycursor.execute(query)

print("PLEASE PROVIDE US THE FOLLOWING PERSONAL DETAILS")

np = int(input("NUMBER OF PASSENGERS:"))
print()

for i in range(1, np + 1):

print("GIVE THE DETAILS OF PASSENGER", i)

passengerno = i

name = input("ENTER THE NAME OF THE PASSENGER:")

gender = input("ENTER THE GENDER OF THE PASSENGER:")

age = int(input("ENTER THE AGE OF THE PASSENGER:"))

s1 = random.randint(1, 30)

s2 = random.randint(0, 5)

list_names = ["A", "B", "C", "D", "E", "F"]

seat = str(s1) + str(list_names[s2])

query = "INSERT INTO passengers VALUES (%s, %s, %s, %s, %s)"

values = (passengerno, name, gender, age, seat)

mycursor.execute(query, values)

mycon.commit()

print()

ddate = input("ENTER YOUR DEPARTURE DATE (DD-MM-YYYY):")

dday = input("ENTER THE DAY OF DEPARTURE:")

query = "SELECT FARE_IN_INR FROM flightbook WHERE FLIGHTNO = %s"

values = (fno,)
mycursor.execute(query, values)

data = mycursor.fetchone()

if data is not None:

tfare = np * data[0]

print("----------------------------------------------------------------------------------------------------------
----------")

print("YOUR NET FARE OF", np, "PASSENGERS IS: Rs", tfare)

print("----------------------------------------------------------------------------------------------------------
----------")

print()

ans3 = input("PROCEED FOR PAYMENT? (Y/N):")

print()

if ans3.lower() == "y":

print("SELECT YOUR MODE OF PAYMENT")

print("1 --> CREDIT AND DEBIT CARDS")

print("2 --> eWALLETS")

print("3 --> BANK TRANSFER")

print()

n = int(input("CHOOSE FROM THE FOLLOWING OPTIONS (1, 2 OR 3):"))

print()

if n == 1:

cardno = int(input("ENTER YOUR CARD NUMBER:"))

print("WAIT FOR A MOMENT...")


print()

print(f"PAYMENT OF Rs {np * data[0]} DONE SUCCESSFULLY")

print("YOUR FLIGHT HAS BEEN BOOKED..")

elif n == 2:

mno = int(input("ENTER YOUR MOBILE NUMBER:"))

print("WAIT FOR A MOMENT...")

print()

print(f"PAYMENT OF Rs {np * data[0]} DONE SUCCESSFULLY")

print("YOUR FLIGHT HAS BEEN BOOKED..")

elif n == 3:

ano = int(input("ENTER YOUR ACCOUNT NUMBER:"))

print("WAIT FOR A MOMENT...")

print()

print(f"PAYMENT OF Rs {np * data[0]} DONE SUCCESSFULLY")

print("YOUR FLIGHT HAS BEEN BOOKED..")

print("-------------------------------------------------------------------------------------------------------
-------------")

print("1 --> PRINT TICKET")

print("2 --> CANCEL BOOKING")

print("3 --> RETURN TO HOMESCREEN")

print()
n = int(input("CHOOSE FROM THE FOLLOWING OPTIONS (1, 2 OR 3):"))

print()

if n == 1:

print("************************************************************************
******** *************************************")

print("HAVE A NICE TRIP!")

print("FLIGHT DETAILS")

query = "SELECT FLIGHTNO, FROM_, TO_, JOURNEY_TIME, AIRLINE FROM


flightbook WHERE FLIGHTNO = %s"

values = (fno,)

mycursor.execute(query, values)

data = mycursor.fetchone()

list4 = []

if data is not None:

list4.append(data)

print(tabulate(list4, headers=headers2, tablefmt="grid"))

print("PASSENGERS DETAILS")

query = "SELECT * FROM passengers"

mycursor.execute(query)

data = mycursor.fetchall()

nrec = mycursor.rowcount
list5 = []

if nrec != 0:

for i in data:

list5.append(i)

print(tabulate(list5, headers=headers3, tablefmt="grid"))

print("DATE AND DAY OF DEPARTURE:", ddate, "/", dday)

hr = random.randint(1, 23)

min = random.randint(10, 59)

if hr < 12:

print("BOARDING TIME:", hr, ":", min, "AM IST")

else:

print("TIME OF FLIGHT:", hr, ":", min, "PM IST")

print("TOTAL AMOUNT PAID: Rs", tfare)

print("************************************************************************
******** *************************************")

print("----------------------------------------------------------------------------------------------------
----------------")

elif n == 2:

print("----------------------------------------------------------------------------------------------------
----------------")

for i in range(1, np + 1):

query = "DROP TABLE IF EXISTS passengers"

mycursor.execute(query)
print("YOUR BOOKING HAS BEEN CANCELED...")

print("!!!YOU WILL GET THE REFUND OF YOUR MONEY IN DUE COURSE OF


TIME!!!")

print("----------------------------------------------------------------------------------------------------
----------------")

start()

elif n == 3:

print("----------------------------------------------------------------------------------------------------
----------------")

print("THANK YOU FOR CHOOSING US TO BOOK YOUR FLIGHTS")

print("----------------------------------------------------------------------------------------------------
----------------")

start()

else:

print("-------------------------------------------------------------------------------------------------------
-------------")

start()

else:

print("Flight details not found.")

start()

else:

print("Booking canceled. Returning to the main menu.")

start()
else:

print("No flights found for the given route.")

start()

if __name__ == "__main__":

login()

start()
OUTPUT SCREENSHOT
Table created in MySQL
SYSTEM TESTING AND MAINTENANCE
Testing can be defined as the project of executing the project in a controlled
manner. In order to answer the question “Does the project behave as specified”.
It also is the only way of finding out whether or not there are any errors in a
system. Therefore testing is an important part of SDLC.
Like all other stages of SDLC, testing needs time and proper resources to become a
meaningful activity. Testing is vital to the success of the system. Testing makes a
logical assumption that if all parts of the system are correct, the goal will be
successfully achieved.
TYPES OF TESTING
Unit testing:- Each component or part of the program is tested individually to
verify that the detailed design for the unit has been correctly implemented.
Module testing:- In large system, a module may be a group of several programs or
functions or sub-module testing.
Integration testing:- It is carried out to find problems in the interface between
resembled unit modules in a system.
System testing:- It is executing a program to check logic changes made in it
and with the intention of finding errors.

MAINTENANCE:
After the implementation, the systems need to be maintained in order to adapt
the changing business and user needs. Different techniques are used to properly
maintain a system like:
1. Correction – correction means to find out the error of the existing system and
then correct them.
2. Adaptation – Adaptation means changes are done in existing software
according the requirement of the new environment.
CONCLUSION
To conclude the software presents the user with a system that satisfies all the
objective of the organization. The system developed presents the user with the
major benefits of user- friendliness, security, and hardware independence. Its data
is also used to generate the reports that are needed by the client of this system.
BIBLIOGRAPHY
https://www.w3schools.com/python/module_random.asp
https://pypi.org/project/tabulate/
https://python.mykvs.in/presentation/presentation2021/class%20xii/

You might also like