CS Project File
CS Project File
DELHI – 110092
SESSION 2024-2025
Fitness Centre in the subject Computer Science (083) laid down in the regulations
(Mr.Akant Sharma)
PGT Comp Science
The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for the success
of the project. I am grateful for their constant support and help.
CONTENTS
1) Introduction
2) System Requirements
3) Source code
4) Output
5) Bibliography
INTRODUCTION
Flight Management System
A flight management system (FMS) is a fundamental component of a modern airliner's
avionics. An FMS is a specialized computer system that automates a wide variety of in-flight
tasks, reducing the workload on the flight crew to the point that modern civilian aircraft no
longer carry flight engineers or navigators. A primary function is in-flight management of the
flight plan. Using various sensors (such as GPS and INS often backed up by radio navigation)
to determine the aircraft's position, the FMS can guide the aircraft along the flight plan. From
the cockpit, the FMS is normally controlled through a Control Display Unit (CDU) which
incorporates a small screen and keyboard or touchscreen. The FMS sends the flight plan for
display to the Electronic Flight Instrument System (EFIS), Navigation Display (ND), or
Multifunction Display (MFD). The FMS can be summarised as being a dual system
consisting of the Flight Management Computer (FMC), CDU and a cross talk bus. The
modern FMS was introduced on the Boeing 767, though earlier navigation computers did
exist.[1] Now, systems similar to FMS exist on aircraft as small as the Cessna 182. In its
evolution an FMS has had many different sizes, capabilities and controls. However certain
characteristics are common to all FMSs.
Need of FMS
1. Minimized documentation and no duplication of records.
2. Reduced paper work.
3. Improved patient care
4. Better Administration Control
5. Faster information flow between various departments
6. Smart Revenue Management
7. Effective billing of various services
8. Exact stock information
SYSTEM REQUIREMENTS
1.Processor
2.Disk Space
3.Operating System
4.Python Version
5.Mysql Version
SOURCE CODE
import mysql.connector
from datetime import datetime
# Database connection
conn = mysql.connector.connect(
host="localhost",
user="rpvv",
password="rpvv"
)
cursor = conn.cursor()
# Admin Functions
def add_flight():
flight_name = input("Enter flight name: ")
departure = input("Enter departure city: ")
destination = input("Enter destination city: ")
departure_date = input("Enter departure date (YYYY-MM-DD): ")
departure_time = input("Enter departure time (HH:MM:SS): ")
arrival_date = input("Enter arrival date (YYYY-MM-DD): ")
arrival_time = input("Enter arrival time (HH:MM:SS): ")
economy_seats = int(input("Enter number of economy seats: "))
business_seats = int(input("Enter number of business seats: "))
first_class_seats = int(input("Enter number of first-class seats: "))
economy_price = float(input("Enter price for economy class: "))
business_price = float(input("Enter price for business class: "))
first_class_price = float(input("Enter price for first class: "))
cursor.execute(query, values)
conn.commit()
print("Flight added successfully!")
def view_flights(admin=False):
print("\nView Flights Options:")
print("1. View all flights")
print("2. View flights by criteria (departure city, destination city, and date)")
if choice == 1:
cursor.execute("SELECT * FROM flights")
flights = cursor.fetchall()
elif choice == 2:
departure = input("Enter departure city: ")
destination = input("Enter destination city: ")
date = input("Enter departure date (YYYY-MM-DD): ")
if not flights:
print("No flights found matching the criteria.")
else:
for flight in flights:
print(f"Flight ID: {flight[0]}, Flight Name: {flight[1]}, Departure: {flight[2]},
Destination: {flight[3]}, "
f"Departure Date: {flight[4]}, Departure Time: {flight[5]}, Arrival Date:
{flight[6]}, Arrival Time: {flight[7]}, "
f"Economy Seats: {flight[8]}, Business Seats: {flight[9]}, First Class Seats:
{flight[10]}")
def view_bookings():
cursor.execute("SELECT * FROM bookings")
bookings = cursor.fetchall()
if not bookings:
print("No bookings found.")
for booking in bookings:
print(f"Booking ID: {booking[0]}, Customer Name: {booking[1]}, Flight ID:
{booking[2]}, Class: {booking[3]}, "
f"Price: {booking[4]}, Departure: {booking[5]}, Destination: {booking[6]},
Departure Date: {booking[7]}, "
f"Departure Time: {booking[8]}, Arrival Date: {booking[9]}, Arrival Time:
{booking[10]}")
# User Functions
def book_ticket():
view_flights(admin=False)
flight_id = int(input("Enter flight ID to book: "))
travel_class = input("Enter class (economy/business/first_class): ").strip().lower()
class_col = {
"economy": ("economy_seats", "economy_price"),
"business": ("business_seats", "business_price"),
"first_class": ("first_class_seats", "first_class_price")
}
if available_seats <= 0:
print("No seats available in this class!")
return
conn.commit()
print(f"Booking confirmed! {num_tickets} tickets booked successfully!")
# Main Menu
def main():
while True:
print("\nChoose your role:")
print("1. Admin")
print("2. User")
print("3. Exit")
role_choice = int(input("Enter choice (1/2/3): ").strip())
if role_choice == 1:
while True:
print("\nAdmin Menu:")
print("1. Add Flight")
print("2. View Flights")
print("3. View Bookings")
print("4. Exit")
admin_choice = int(input("Enter choice (1/2/3/4): ").strip())
if admin_choice == 1:
add_flight()
elif admin_choice == 2:
view_flights(admin=True)
elif admin_choice == 3:
view_bookings()
elif admin_choice == 4:
break
else:
print("Invalid option. Please try again.")
elif role_choice == 2:
while True:
print("\nUser Menu:")
print("1. Book Ticket")
print("2. View Flights")
print("3. Exit")
user_choice = int(input("Enter choice (1/2/3): ").strip())
if user_choice == 1:
book_ticket()
elif user_choice == 2:
view_flights(admin=False)
elif user_choice == 3:
break
else:
print("Invalid option. Please try again.")
elif role_choice == 3:
print("Exiting the system. Goodbye!")
break
else:
print("Invalid input. Please try again.")
if __name__ == "__main__":
main()
conn.close()
OUTPUT
#Admin interface
1)Add Flights
2)View Flights
3)View Bookings
# User interface
1)Booking ticket
2)View Flight by criteria
# Mysql
1)Flights
2) Bookings
BIBLIOGRAPHY
Websites :
https://kvcoders.in/class-12-new-content/python-project/