Flight Management System - CS Project
Flight Management System - CS Project
1. Certificate
2. Acknowledgment
5. Database Design
7. Source Code
8. Output
9. Conclusion
Page 1 of 35
Page 2 of 35
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to everyone who contributed to the success of
this Python project. Their support, expertise, and encouragement were instrumental in
making this endeavour a reality.
I extend my deepest appreciation to Mr. Deepak Pithadia, whose guidance and mentorship
played a crucial role in shaping the project and pushing it to new heights. Your invaluable
insights and commitment to excellence have been truly inspiring.
Additionally, I appreciate the open-source community and the authors of the libraries and
frameworks used in this project. Their collective efforts have paved the way for efficient
development and have been instrumental in the project's functionality.
Thank you to everyone who played a part, directly or indirectly, in bringing this Python
project to fruition.
Sincerely,
Page 3 of 35
PROJECT OVERVIEW
management of Flights. This project uses state – of - the - art language which are Python and
MYSQL, one of the finest database connectivity tools available in the market today. This
software code provides basic but accurate information of the flights with various details.
1) Usage of Python :
Python's versatility and readability makes it ideal for web development, data
2) Usage of MySQL :
Page 4 of 35
SYSTEM SPECIFICATION
SOFTWARE AND HARDWARE
For optimal performance of Python and MySQL software, a system with a modern processor
(e.g., Intel Core i5 or equivalent), 8GB RAM, and sufficient storage (256GB SSD or higher) is
recommended. Install the latest versions of Python and MySQL, ensuring compatibility with
the operating system. Adequate bandwidth for internet connectivity is essential for updates
environment for Python projects and employing indexing and caching mechanisms in MySQL
for enhanced database performance. Regularly update system components, libraries, and
security patches to maintain stability and security in both Python and MySQL environments.
Page 5 of 35
DATABASE DESIGN
Page 6 of 35
BRIEF INTRODUCTION ABOUT
MODULES
1. mysql.connector
These are the external modules in the provided code. Other aspects, such as loops,
conditionals, and function definitions, use Python's built-in functionality.
Page 7 of 35
CODING
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="aviation101",
database='flight_management_system')
print(mydb)
print('Connection Established!')
#Defining Functions.
def display_menu1():
print('\nMENU : ')
print('+--------------------------+')
print('| PLEASE ENTER YOUR CHOICE |')
print('+--------------------------+')
print('| 1. ARRIVALS |')
print('| 2. DEPARTURES |')
print('| 3. ADMINISTRATION |')
print('| 4. EXIT MENU |')
print('+--------------------------+')
def print_flight_status_menu():
print('+------------------------------------------------+')
print('| PLEASE ENTER YOUR SUB CHOICE |')
print('+------------------------------------------------+')
print('| 1. Check your flight status by date. |')
print('| 2. Check your flight status by airline. |')
print('| 3. Exit. |')
print('+------------------------------------------------+')
def display_menu2():
print('+-------------------------------------------+')
print('| PLEASE MAKE YOUR CHOICE |')
print('+-------------------------------------------+')
print('| 1. Check your flight status by date. |')
print('| 2. Check your flight status by airline. |')
print('| 3. Exit. |')
print('+-------------------------------------------+')
def display_menu3():
print('+-------------------------------------------------------+')
Page 8 of 35
print('| PLEASE SELECT ADMINISTRATION OPTION |')
print('+-------------------------------------------------------+')
print('| 1. INSERT FLIGHT DETAILS |')
print('| 2. UPDATE FLIGHT DETAILS |')
print('| 3. DELETE FLIGHT DETAILS |')
print('| 4. Exit. |')
print('+-------------------------------------------------------+')
while True:
display_menu1() #Calling the function.
if passenger_choice == 1:
while True:
print_flight_status_menu() #Calling the function.
# Calling the relevant method based on users choice using if-else loop.
if choice1 == 1:
print('============================== \n')
print('Your Arrival Flight Status By Date :- ')
print('============================== \n')
mycursor = mydb.cursor()
mycursor.execute("SELECT FlightName as 'Flight Name', FlightID as 'Flight ID',
AirlinesName as 'Airlines "
"Name',AircraftType as 'Aircraft Type',ArrivalOrDeparture 'Arrival or
Departure',"
"ScheduledTime as 'Scheduled Time',ExpectedTime as 'Expected
Time',FlightStatus as 'Flight "
"Status',OriginName as 'Origin',DestinationName as 'Destination' FROM
flightstatus where "
"ArrivalOrDeparture='Arrival' order by ScheduledTime")
myresult = mycursor.fetchall()
for x in myresult:
Page 9 of 35
print(x)
elif choice1 == 2:
print('============================== \n')
print('Your Arrival Flight Status By Airlines : ')
print('============================== \n')
mycursor = mydb.cursor()
mycursor.execute("SELECT FlightName as 'Flight Name', FlightID as 'Flight ID',
AirlinesName as 'Airlines "
"Name',AircraftType as 'Aircraft Type',ArrivalOrDeparture 'Arrival or
Departure',"
"ScheduledTime as 'Scheduled Time',ExpectedTime as 'Expected
Time',FlightStatus as 'Flight "
"Status',OriginName as 'Origin',DestinationName as 'Destination' FROM
flightstatus where "
"ArrivalOrDeparture='Arrival' order by AirlinesName")
myresult = mycursor.fetchall()
for x in myresult:
print(x)
elif choice1 == 3:
break
else:
print('Invalid choice. Please try again!')
elif passenger_choice == 2:
while True:
display_menu2()
Page 10 of 35
myresult = mycursor.fetchall()
for x in myresult:
print(x)
elif choice1 == 2:
print('============================== \n')
print('Your Departure Flight Status By Airlines : ')
print('============================== \n')
mycursor = mydb.cursor()
mycursor.execute("SELECT FlightName as 'Flight Name', FlightID as 'Flight ID',
AirlinesName as 'Airlines "
"Name',AircraftType as 'Aircraft Type',ArrivalOrDeparture 'Arrival or
Departure',"
"ScheduledTime as 'Scheduled Time',ExpectedTime as 'Expected
Time',FlightStatus as 'Flight "
"Status',OriginName as 'Origin',DestinationName as 'Destination' FROM
flightstatus where "
"ArrivalOrDeparture='Departure' order by AirlinesName")
myresult = mycursor.fetchall()
for x in myresult:
print(x)
elif choice1 == 3:
break
else:
print('Invalid choice. Please try again!')
elif passenger_choice == 3:
display_menu3()
print('============================== ')
print('ENTER FLIGHT DETAILS : ')
print('============================== \n')
flCode = int(input('Enter Flight Code (In Numbers) : '))
flID = int(input('Enter Flight ID (In Numbers) : '))
flame = (input('Enter Flight Name : '))
ArID = int(input('Enter AirLine ID (In Numbers) : '))
ArName = (input('Enter AirLine Name : '))
ArType = (input('Enter Aircraft Type (Cargo or Passenger) : '))
Page 11 of 35
AOrD = (input('Arrival or Departure : '))
ScheduleTime = (input('Enter Flight Scheduled Time : '))
ExpectedTime = (input('Enter Flight Expected Time : '))
FlightStatus = (input('Enter Flight Status (ON TIME or DELAYED) : '))
OriginName = (input('Enter Flight Origin Name : '))
DestinationName = (input('Enter Destination Name : '))
if choice1 == 2:
#Code to Update Flight details will be executed as below
print('============================== ')
print('ENTER FLIGHT CODE TO UPDATE DETAILS : ')
print('============================== \n')
flCode = int(input('Enter Flight Code (In Numbers) : '))
mycursor = mydb.cursor()
mycursor.execute("SELECT FlightName as 'Flight Name', FlightID as 'Flight ID',
AirlinesName as 'Airlines "
"Name',AircraftType as 'Aircraft Type',ArrivalOrDeparture 'Arrival or
Departure',"
"ScheduledTime as 'Scheduled Time',ExpectedTime as 'Expected
Time',FlightStatus as 'Flight "
"Status',OriginName as 'Origin',DestinationName as 'Destination' FROM
flightstatus where "
"Flightcode = %s", (flCode,))
myresult = mycursor.fetchall()
for x in myresult:
print(x)
Page 12 of 35
flID = int(input('Enter Flight ID (In Numbers) : '))
flame = (input('Enter Flight Name : '))
ArID = int(input('Enter AirLine ID (In Numbers) : '))
ArName = (input('Enter AirLine Name : '))
ArType = (input('Enter Aircraft Type (Cargo or Passenger) : '))
AOrD = (input('Arrival or Departure : '))
ScheduleTime = (input('Enter Flight Scheduled Time : '))
ExpectedTime = (input('Enter Flight Expected Time : '))
FlightStatus = (input('Enter Flight Status (ON TIME or DELAYED) : '))
OriginName = (input('Enter Flight Origin Name : '))
DestinationName = (input('Enter Destination Name : '))
query1 = """
UPDATE FLIGHTSTATUS
SET FlightID = %s, FlightName = %s, AirlinesID = %s, AirlinesName = %s, AircraftType =
%s,
ArrivalOrDeparture = %s, ScheduledTime = %s, ExpectedTime = %s, FlightStatus =
%s,
OriginName = %s, DestinationName = %s
WHERE FlightCode = %s
"""
values = (flID, flame, ArID, ArName, ArType, AOrD, ScheduleTime, ExpectedTime,
FlightStatus, OriginName, DestinationName, flCode )
if cursor.rowcount > 0:
print(cursor.rowcount, "record(s) updated")
else:
print("No record found with that Flight Code.")
display_menu3()
if choice1 == 3:
#Code to Delete Flight details will be executed as below
print('============================== ')
print('ENTER FLIGHT CODE TO DELETE DETAILS : ')
print('============================== \n')
flCode = int(input('Enter Flight Code (In Numbers) : '))
query = "DELETE FROM FLIGHTSTATUS WHERE FlightCode= %s"
values= (flCode,)
cursor = mydb.cursor()
Page 13 of 35
cursor.execute(query, values)
mydb.commit()
print(cursor.rowcount, "record(s) deleted")
display_menu3()
if choice1 == 4:
#Code to Exit Flight details will be executed as below
else:
print('No details entered.')
break
elif passenger_choice == 4:
print('THANK YOU FOR USING FLIGHT MANAGEMENT SYSTEM!')
break
else:
print('Invalid choice, Please Try Again !')
print()
Page 14 of 35
OUTPUT SCREENSHOTS
MySQL
Page 15 of 35
Page 16 of 35
Page 17 of 35
MySQL – Output
Page 18 of 35
Page 19 of 35
Python
Page 20 of 35
Page 21 of 35
Page 22 of 35
Page 23 of 35
Page 24 of 35
Page 25 of 35
Page 26 of 35
Python - Output
Page 27 of 35
Page 28 of 35
Page 29 of 35
Page 30 of 35
Page 31 of 35
Page 32 of 35
CONCLUSION
In conclusion, this Flight Management System project provides us with the opportunity to
understand Python as a language and the MySQL Database management system and how
these tools help us resolve the real world problems. In this project I learned how to use
various system libraries and various MySQL functions to create, store and display data from
the server to users on a single click of a button within a fraction of a second.
This project also helped me learn how to use internet to search information, decoding and
debugging the python program. This project also provided me with an opportunity to discuss
project related problems with my classmates and search for solutions just like a small team,
which taught me the valuable lesson of being a team player.
Page 33 of 35
BIBLIOGRAPHY
1. Mathplanet :
https://www.mathplanet.com
2. DataCamp :
https://datacamp.com
3. GeeksforGeeks :
https://geeksforgeeks.org
Page 34 of 35