CS PROJECT (Flight management System)2
CS PROJECT (Flight management System)2
SYSTEM
Name: Arjun K
Class: XII F
Roll No: 14
School: Devamatha CMI Public School
Year: 2024-25
pg. 1
ACKNOWLEDGEMENT
I would like to extend my heartfelt gratitude to the Almighty
for bestowing upon me the wisdom, determination, and
opportunity to embark on this journey of creating a computer
project. Without this divine guidance, the path would have
been much more challenging. My deepest thanks go to our
esteemed Principal, whose unwavering support and
encouragement have been instrumental in turning this project
into a reality. Their belief in the potential of their students and
their dedication to fostering an environment conducive to
learning have been truly inspiring.
I am profoundly appreciative of Mr. Srinath O., my Computer
Science teacher, whose exceptional guidance and expertise
have been invaluable throughout the development of this
project. His commitment to nurturing my technical skills and
providing insightful feedback has significantly contributed to
my growth and the project's success. Mr. Srinath's
encouragement and support have been a driving force in
overcoming challenges and achieving the project's goals.
I also want to acknowledge the vital role played by my
collaborators, Evin and Joseph. Their contributions and
collaborative spirit have been crucial to the project's
completion, and working with them has been both productive
and rewarding. Furthermore, I am deeply grateful to my
parents for their constant support, sacrifices, and unwavering
belief in my abilities. Their encouragement and love have
been the bedrock of my achievements, and I am truly blessed
to have them by my side.
pg. 2
CONTENTS
SL.NO. TITLE PAGE NO.
1 OBJECTIVE & 4
SCOPE
2 SYSTEM 5
REQUIREMENTS
I)HARDWARE
II)SOFTWARE
3 INTRODUCTION 6
TO PYTHON
4 DESIGN OF THE 8
PROGRAM
I)VARIABLES USED
I)MODULES USED
II) FUNCTIONS
USED
III)FILES USED
5 PROGRAM CODE 12
6 SAMPLE OUTPUTS 17
7 CONCLUSION 20
8 BIBLIOGRAPHY 21
pg. 3
OBJECTIVE AND SCOPE
Our objective is to develop a robust software
solution that showcases our proficiency in
programming while addressing key challenges in
aviation management. This project aims to
leverage our knowledge in data structures, user
interface design, and data management to improve
our problem-solving and programming
capabilities.
We plan to create a comprehensive system that
enables users to efficiently manage flight records,
including functionalities for adding, viewing,
updating, and deleting flight information. The
scope of our project will encompass features such
as secure user authentication, intuitive and
accessible user interfaces, and essential security
protocols to safeguard data.
Through this initiative, we aspire to deepen our
understanding of computer science principles
while delivering a practical and user-friendly
Flight Management System. The project will be
accompanied by detailed documentation to ensure
clarity and usability.
pg. 4
SYSTEM REQUIREMENTS
HARDWARE:
SOFTWARE:
pg. 5
INTRODUCTION TO PYTHON
pg. 6
Python’s strong community support ensures continuous
improvements and a wealth of resources for learning
and problem-solving, making it a reliable choice for
both novice and experienced developers.
In an era where technology is rapidly evolving, Python's
flexibility and broad application range position it as a
key player in shaping future innovations. Its role in
emerging fields like machine learning and automation
highlights its relevance and enduring appeal. Whether
for developing robust applications, analysing large
datasets, or experimenting with cutting-edge
technologies, Python stands out as a versatile and
dynamic tool that meets the demands of modern
software development
pg. 7
Design of the program
MODULES USED:
TYPE USE
CSV Used for reading
from and writing CSV
files. It provides
functions for working
with CSV data
tabulate Used for formatting
and displaying flight
data in a tabular
format.
datetime Used for parsing and
formatting date and
time values in flight
records.
pg. 8
FUNCTIONS USED
TYPE USE PARAMETER RETURN
Read_ fight_ Reads flight data `filename (str)` -The List of flight
from a CSV file
data(filename) and returns it as
name of the CSV file records (list of
a list of to read. dicts).
dictionaries.
Write_flight_data Writes flight Filename(str)-the None
(filename, flights) data to a CSV name of the CSV file
file to write to, flights
(list)- The list of flight
records.
Display_flights_ Displays `flights (list)` -The list None
table(flights) flight data in of flight records to
a tabular display.
format using
the tabulate
module.
Add_ flight(flights) Adds a new `Flights` (list) -The None
flight record list of flight records.
to the flights
list
Update_ flight(flights, Flight record `Flight` (str)- The ID None
flight id, new_flight_ in the of the flight to
data) `flights` list update, `new flight
data` (dict) -The
updated flight data.
Delete_flight (flights, Deletes a `Flights` (list)- The None
fight id) flight record list of flight records,
from the `flight id` (str)-The ID
flights list. of the flight to
delete.
Search_flight(flights) Searches for a flights None
flight by flight
ID or model
(list) - The list
and displays of flight records to
the results. search through
pg. 9
VARIABLES USED
TYPE DATA TYPE USE
pg. 10
FILES USED
NAME USE
Flights.csv For storing sample data
pg. 11
Program CODE
import csv
from tabulate import tabulate
from datetime import datetime
pg. 12
"Passengers"]
flight_data = []
for flight in flights:
flight_info = [
flight['flight_id'],
flight['model'],
flight['arrival_time'],
flight['arrival_location'],
flight['departure_time'],
flight['departure_location'],
flight['passengers']
]
flight_data.append(flight_info)
print(tabulate(flight_data, headers,
tablefmt="fancy_grid"))
flight = {
'flight_id': flight_id,
'model': model,
'arrival_time': arrival_time,
'arrival_location': arrival_location,
'departure_time': departure_time,
'departure_location': departure_location,
'passengers': passengers
}
flights.append(flight)
print("Flight added successfully!")
pg. 13
if flight['flight_id'] == flight_id:
flight.update(new_flight_data)
return True
return False
if found_flights:
print("\nSearch Results:")
display_flights_table(found_flights)
else:
print("No flights found with the provided
Flight ID or Model.")
if __name__ == "__main__":
# Load flight data from the CSV file
flights = read_flight_data(CSV_FILENAME)
while True:
print("\nFlight Management System")
print("1. View All Flights")
print("2. Add a New Flight")
print("3. Update a Flight")
print("4. Delete a Flight")
print("5. Search for a Flight")
print("6. Exit")
if choice == '1':
display_flights_table(flights)
pg. 14
add_flight(flights)
write_flight_data(CSV_FILENAME, flights)
pg. 15
delete_flight(flights, flight_id)
write_flight_data(CSV_FILENAME, flights)
else:
print("Invalid choice. Please enter a valid
option.")
pg. 16
SAMPLE OUTPUTS
ADDING FLIGHT
VIEWING FLIGHTS
pg. 17
UPDATING FLIGHTS
SEARCHING FLIGHTS
pg. 18
DELETING FLIGHTS
pg. 19
CONCLUSION
In conclusion, this Python file handling project has
provided valuable insights into efficiently
managing and manipulating data stored in files.
We have covered various file operations, including
reading, writing, appending, and creating
directories, which have allowed us to understand
how Python handles different aspects of file
management. By working through these processes,
we've gained practical experience that has
enhanced our understanding of Python's powerful
file handling features.
As we wrap up this project, it is clear that the skills
acquired are not only relevant but also versatile,
applicable to a wide range of real-world scenarios.
Whether building data processing workflows,
automating tasks, or designing user-friendly file
management systems, the knowledge gained from
this project can be leveraged in many applications.
Python's ease of use and robustness in handling
files makes it a valuable tool for developing
efficient and effective data management solutions.
pg. 20
BIBLIOGRAPHY
• Python Software Foundation. (2023). Python Documentation: Input and
Output. Retrieved from
https://docs.python.org/3/tutorial/inputoutput.html
• Sweigart, A. (2019). Automate the Boring Stuff with Python: Practical
Programming for Total Beginners. 2nd Edition. No Starch Press.
• Real Python Team. (2022). Working with Files in Python. Real Python.
Retrieved from https://realpython.com/read-write-files-python/
• Beazley, D., & Jones, B. (2013). Python Cookbook: Recipes for Mastering
Python 3. 3rd Edition. O'Reilly Media
• Zelle, J. (2004). Python Programming: An Introduction to Computer
Science. Franklin, Beedle & Associates Inc.
• W3Schools. (2022). Python File Handling. Retrieved from
https://www.w3schools.com/python/python_file_handling.asp
• GeeksforGeeks. (2021). File Handling in Python. GeeksforGeeks.
Retrieved from https://www.geeksforgeeks.org/file-handling-python/
• Hetland, M. L. (2005). Beginning Python: From Novice to Professional.
Après.
pg. 21