Title:Flight Management System
Introduction
Java is a powerful, high-level, and object-oriented programming language that has
been widely used in software development for several decades. It is known for its
platform independence, meaning applications written in Java can run on any
system that supports the Java Virtual Machine (JVM). With features such as
strong memory management, built-in security, and extensive libraries, Java is well
suited for developing robust, scalable, and maintainable applications. Because of
these qualities, Java is commonly used in enterprise systems, web applications,
mobile apps, and large-scale management systems.
Building on these strengths, Java is an excellent choice for designing a Flight
Management System, which is a real-world application used to organize and
monitor flight operations. A flight management system helps store and manage
essential flight details such as Flight Number, Source, Destination, and Status.
Each flight can be modeled as a Java class, where these attributes define the
properties of a flight object. This object-oriented approach makes the system
easier to understand, extend, and maintain.
To ensure the system reflects real-time conditions, methods are implemented to
update the flight status, allowing changes such as on-time, delayed, or canceled.
Furthermore, by using methods that return objects or collections, the system can
efficiently retrieve all flights for a specific route, such as flights traveling from
one city to another. This not only improves data handling but also demonstrates
how Java supports clean logic flow, reusability, and effective data management
in real-world applications.
Dept. of CSE 2025-26 1
Flight Management System
Problem Statement
PROBLEM :
• Build a flight management system with attributes like FlightNumber, Source,
Destination, and Status.
• Include methods to update flight status (on-time, delayed, canceled).
• Use returning objects to fetch all flights for a specific route.
Flight Attributes :
o FlightNumber: Unique identifier (e.g., AI202).
o Source: Departure city/airport.
o Destination: Arrival city/airport.
o Status: Current state (On-Time, Delayed, Canceled).
System Design Considerations:
o Modular class design – separate classes used
o Object-oriented approach – real-world modeling
o Dynamic data storage – resizable flight list
o Unique flight identification – flight number key
o Simple user input/output – console interaction
Dept. of CSE, BIT 2025-26
2
Flight Management System
Design and Implementation
CODE :
import [Link];
import [Link];
class Flight {
String flightNumber;
String source;
String destination;
String status;
Flight(String flightNumber, String source, String destination, String status) {
[Link] = flightNumber;
[Link] = source;
[Link] = destination;
[Link] = status;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
ArrayList<Flight> flights = new ArrayList<>();
Dept. of CSE, BIT 2025-26
3
[Link]("Enter number of flights: ");
int n = [Link]();
[Link]();
for (int i = 0; i < n; i++) {
[Link]("\nEnter flight details:");
[Link]("Flight Number: ");
String fn = [Link]();
[Link]("Source: ");
String src = [Link]();
[Link]("Destination: ");
String dest = [Link]();
[Link]("Status (On-Time/Delayed/Canceled): ");
String status = [Link]();
[Link](new Flight(fn, src, dest, status));
[Link]("\nEnter flight number to update status: ");
String updateFn = [Link]();
[Link]("Enter new status: ");
String newStatus = [Link]();
for (Flight f : flights) {
if ([Link](updateFn)) {
[Link] = newStatus;
Dept. of CSE, BIT 2025-26
4
}
[Link]("\nEnter source to search: ");
String searchSrc = [Link]();
[Link]("Enter destination to search: ");
String searchDest = [Link]();
[Link]("\nFlights on this route:");
for (Flight f : flights) {
if ([Link](searchSrc) &&
[Link](searchDest)) {
[Link]([Link] + " - " + [Link]);
[Link]();
Dept. of CSE, BIT 2025-26
5
Flight Management System
Results
Enter number of flights: 2
Enter flight details:
Flight Number: AIR INDIA 213
Source: India
Destination: New York
Status (On-Time/Delayed/Canceled): On-time
Enter flight details:
Flight Number: BOEING 367
Source: England
Destination: Banglore
Status (On-Time/Delayed/Canceled): Delayed
Enter flight number to update status: BOEING 367
Enter new status: canceled
Enter source to search: India
Enter destination to search: New York
Flights on this route:
AIR INDIA 213 – On-time
Dept. of CSE, BIT 2025-26
6