SlideShare a Scribd company logo
1 of 4
CSCI 1101 Computer Science II Assignment 3
FOR MORE CLASSES VISIT
tutorialoutletdotcom
This assignment will test your skills in object-oriented programming
with multiple classes and the use of ArrayLists as the data structure. You
are to design a program that implements a basic Airline Booking System
(ABS). The ABS allows a client program to create airports, airlines, and
flights. Each flight has an originating airport (origin) and a destination
airport (destination). The origin and destination cannot be the same.
Each flight consists of seats organized in rows. Each row has six seats
(“A”, “B”, “C”, “D”, “E”, “F”). Your program should have the
following functionality: 1. Create an airport: An airport must have a
name consisting of exactly three alphabetic characters. No two airports
can have the same name. 2. Create an airline: An airline has a name that
must have a length less than 6 alphabetic characters. No two airlines can
have the same name. 3. Create a flight given an airline name, the name
of the originating airport, the name of a destination airport, and a flight
number: A flight has an identifier that is a string of alphanumeric
characters. 4. Create seats for a flight: The number of rows of seats for
this flight is provided. 5. Find available flights: Finds all flights from an
originating airport to a destination airport. 6. Book a seat: Books an
available seat from a given origin to a given destination on a given
flight. 7. Print system details: Displays attributes of all objects (e.g.,
airports, airlines, etc.) in the system. Your program must have the
following classes: 1. System Manager class: This is the main class that
aggregates the other classes and provides functionality to the client
program. A client program with a main method accesses the System
Manager class. This class has the following attributes: Airports – an
arraylist of airport objects, initially empty. Airlines – an arraylist of
airline objects, initially empty. Flights – an arraylist of flight objects,
initially empty. If required, add other attributes. The class has the
following methods: createAirport(String n): Creates an airport object
and updates the appropriate arraylist. The airport will have a name
(code) n; n must have exactly three alphabetic characters. No two
airports can have the same name. createAirline(String n): Creates an
airline object with name n and updates the appropriate arraylist. An
airline has a name that must have a length less than 6. No two airlines
can have the same name. createFlight(String aname, String orig, String
dest, String id): Creates a flight for an airline named aname, from an
originating airport (orig) to a destination airport (dest). The flight has an
identifier (id). createSeats(String air, String flID, int rows): Creates seats
with the given number of rows for a flight with identifier flID,
associated with an airline, air. findAvailableFlights(String orig, String
dest): Finds all flights from airport orig to airport dest. bookSeat(String
air, String fl, int row, char col): Books seat in given row and column on
flight fl of airline air, if that particular seat is still available.
displaySystemDetails(): Displays attribute values for all objects (e.g.,
airports, flights) in the system. 2. Airport class: The only information
that is maintained in this class is the name, which must be three
alphabetic characters. Add the appropriate get, set and toString methods.
3. Airline class: This class maintains information about airlines. All
flights for a given airline must have unique ids. 4. Flight class: This class
maintains information about flights. It has the following attributes: a.
Airline b. Flight id c. Originating airport and destination airport d. Seats:
An array of Seat objects. 5. Add appropriate attributes (e.g., you could
also have the originating and destination airports as attributes for a
flight) and methods. Seat class: This class maintains information about
seats. Each seat has an identifier (a seat is identified by a row number
and a column character, which is a letter from A to F). All flights have 6
seats per row. For example, you could have a seat called 2A meaning it
is the first seat in the second row, or 10B which means the second seat in
row 10). Seat also has a status which indicates if the seat is booked or
available. Add the appropriate attributes and methods. The following is a
sample client program with a main method that calls operations in the
SystemManager. You must create your own test program. public class
Client{
public static void main (String args){
SystemManager res = new SystemManager();
//create airports
res.createAirport(“YHZ”);
res.createAirport(“YYZ”);
res.createAirport(“YUL”);
res.createAirport(“YVR”);
res.createAirport(“YYC”);
res.createAirport(“LONDON”); //invalid
res.createAirport(“123”); //invalid
res.createAirport(“YEG”);
res.createAirport(“BOS”);
res.createAirport(“JFK”);
//create airlines
res.createAirline(“AC”);
res.createAirline(“DELTA”);
res.createAirline(“USAIR”);
res.createAirline(“WSJET”);
res.createAirline(“FRONTIER”); //invalid
//create flights
res.createFlight(“AC”,
res.createFlight(“AC”,
res.createFlight(“AC”,
res.createFlight(“AC”, “YHZ”,
“YHZ”,
“YUL”,
“YUL”, “YUL”,
“YYZ”,
“YHZ”,
“YVR”, “123”);
“567”);
“789”);
“123”); //invalid – AC cannot have two flights with same id.
res.createFlight(“AC”, “YHZ”, “YYZ”, “689”);
res.createFlight(“DELTA”, “YHZ”, “BOS”, “123”);
//etc.
//create seats
res.createSeats(“AC”, “123”, 40);
res.createSeats(“DELTA”, “123”, 25);
//etc.
//find available flights
res.findAvailableFlights(“YHZ”, “YYZ”);
//book seats
res.bookSeat(“AC”, “123”, 1, ‘A’);
res.bookSeat(“AC”,“123”,20,‘F’);
res.bookSeat(“AC”, “506”, 2, ‘B’); //invalid – 506 not created
res.bookSeat(“AC”, “123”, 55, ‘C’); //invalid – row 55 doesn’t exist
//display system details
res.displaySystemDetails(); }
} Submit your all your java files and sample outputs.
************************************************

More Related Content

Similar to CSCI 1101 Assignment - Airline Booking System

In this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdfIn this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdfivylinvaydak64229
 
JAVA The file being read is called flightdatatxt please in.pdf
JAVA The file being read is called flightdatatxt please in.pdfJAVA The file being read is called flightdatatxt please in.pdf
JAVA The file being read is called flightdatatxt please in.pdfadinathassociates
 
Comp 255 Project F2009
Comp 255 Project F2009Comp 255 Project F2009
Comp 255 Project F2009guest008f82
 
ECS 40 Program #1 (50 points, my time 2.5 hours) .docx
ECS 40           Program #1 (50 points, my time 2.5 hours)    .docxECS 40           Program #1 (50 points, my time 2.5 hours)    .docx
ECS 40 Program #1 (50 points, my time 2.5 hours) .docxjack60216
 
Practical java
Practical javaPractical java
Practical javanirmit
 
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdf
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdfFedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdf
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdfalukkasprince
 
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxjack60216
 
sql code for this question below Portland Airports Ltd would like a.pdf
sql code  for this question below  Portland Airports Ltd would like a.pdfsql code  for this question below  Portland Airports Ltd would like a.pdf
sql code for this question below Portland Airports Ltd would like a.pdfdawarhosy
 
#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docxmayank272369
 
Android AOS practical programs.pdf
Android AOS practical programs.pdfAndroid AOS practical programs.pdf
Android AOS practical programs.pdfRonakTumma
 
The first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfThe first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfneerajsachdeva33
 
S7 amruta bppoddar_2
S7 amruta bppoddar_2S7 amruta bppoddar_2
S7 amruta bppoddar_2Zubair Anwar
 
S7 amruta bppoddar
S7 amruta bppoddarS7 amruta bppoddar
S7 amruta bppoddar174w
 

Similar to CSCI 1101 Assignment - Airline Booking System (20)

In this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdfIn this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdf
 
A06
A06A06
A06
 
JAVA The file being read is called flightdatatxt please in.pdf
JAVA The file being read is called flightdatatxt please in.pdfJAVA The file being read is called flightdatatxt please in.pdf
JAVA The file being read is called flightdatatxt please in.pdf
 
Comp 255 Project F2009
Comp 255 Project F2009Comp 255 Project F2009
Comp 255 Project F2009
 
ECS 40 Program #1 (50 points, my time 2.5 hours) .docx
ECS 40           Program #1 (50 points, my time 2.5 hours)    .docxECS 40           Program #1 (50 points, my time 2.5 hours)    .docx
ECS 40 Program #1 (50 points, my time 2.5 hours) .docx
 
Practical java
Practical javaPractical java
Practical java
 
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdf
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdfFedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdf
FedExPlanes7.txt1 medical 111 Boeing767 120000 London 3 packages.pdf
 
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
 
Assignment in java
Assignment in javaAssignment in java
Assignment in java
 
Program
ProgramProgram
Program
 
sql code for this question below Portland Airports Ltd would like a.pdf
sql code  for this question below  Portland Airports Ltd would like a.pdfsql code  for this question below  Portland Airports Ltd would like a.pdf
sql code for this question below Portland Airports Ltd would like a.pdf
 
Assigment 3
Assigment 3Assigment 3
Assigment 3
 
EEE 3rd year oops cat 3 ans
EEE 3rd year  oops cat 3  ansEEE 3rd year  oops cat 3  ans
EEE 3rd year oops cat 3 ans
 
#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx
 
Android AOS practical programs.pdf
Android AOS practical programs.pdfAndroid AOS practical programs.pdf
Android AOS practical programs.pdf
 
The first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdfThe first part of the assignment involves creating very basic GUI co.pdf
The first part of the assignment involves creating very basic GUI co.pdf
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
Er2
Er2Er2
Er2
 
S7 amruta bppoddar_2
S7 amruta bppoddar_2S7 amruta bppoddar_2
S7 amruta bppoddar_2
 
S7 amruta bppoddar
S7 amruta bppoddarS7 amruta bppoddar
S7 amruta bppoddar
 

Recently uploaded

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

CSCI 1101 Assignment - Airline Booking System

  • 1. CSCI 1101 Computer Science II Assignment 3 FOR MORE CLASSES VISIT tutorialoutletdotcom This assignment will test your skills in object-oriented programming with multiple classes and the use of ArrayLists as the data structure. You are to design a program that implements a basic Airline Booking System (ABS). The ABS allows a client program to create airports, airlines, and flights. Each flight has an originating airport (origin) and a destination airport (destination). The origin and destination cannot be the same. Each flight consists of seats organized in rows. Each row has six seats (“A”, “B”, “C”, “D”, “E”, “F”). Your program should have the following functionality: 1. Create an airport: An airport must have a name consisting of exactly three alphabetic characters. No two airports can have the same name. 2. Create an airline: An airline has a name that must have a length less than 6 alphabetic characters. No two airlines can have the same name. 3. Create a flight given an airline name, the name of the originating airport, the name of a destination airport, and a flight number: A flight has an identifier that is a string of alphanumeric characters. 4. Create seats for a flight: The number of rows of seats for this flight is provided. 5. Find available flights: Finds all flights from an originating airport to a destination airport. 6. Book a seat: Books an available seat from a given origin to a given destination on a given flight. 7. Print system details: Displays attributes of all objects (e.g., airports, airlines, etc.) in the system. Your program must have the following classes: 1. System Manager class: This is the main class that aggregates the other classes and provides functionality to the client program. A client program with a main method accesses the System Manager class. This class has the following attributes: Airports – an arraylist of airport objects, initially empty. Airlines – an arraylist of airline objects, initially empty. Flights – an arraylist of flight objects,
  • 2. initially empty. If required, add other attributes. The class has the following methods: createAirport(String n): Creates an airport object and updates the appropriate arraylist. The airport will have a name (code) n; n must have exactly three alphabetic characters. No two airports can have the same name. createAirline(String n): Creates an airline object with name n and updates the appropriate arraylist. An airline has a name that must have a length less than 6. No two airlines can have the same name. createFlight(String aname, String orig, String dest, String id): Creates a flight for an airline named aname, from an originating airport (orig) to a destination airport (dest). The flight has an identifier (id). createSeats(String air, String flID, int rows): Creates seats with the given number of rows for a flight with identifier flID, associated with an airline, air. findAvailableFlights(String orig, String dest): Finds all flights from airport orig to airport dest. bookSeat(String air, String fl, int row, char col): Books seat in given row and column on flight fl of airline air, if that particular seat is still available. displaySystemDetails(): Displays attribute values for all objects (e.g., airports, flights) in the system. 2. Airport class: The only information that is maintained in this class is the name, which must be three alphabetic characters. Add the appropriate get, set and toString methods. 3. Airline class: This class maintains information about airlines. All flights for a given airline must have unique ids. 4. Flight class: This class maintains information about flights. It has the following attributes: a. Airline b. Flight id c. Originating airport and destination airport d. Seats: An array of Seat objects. 5. Add appropriate attributes (e.g., you could also have the originating and destination airports as attributes for a flight) and methods. Seat class: This class maintains information about seats. Each seat has an identifier (a seat is identified by a row number and a column character, which is a letter from A to F). All flights have 6 seats per row. For example, you could have a seat called 2A meaning it is the first seat in the second row, or 10B which means the second seat in row 10). Seat also has a status which indicates if the seat is booked or available. Add the appropriate attributes and methods. The following is a sample client program with a main method that calls operations in the SystemManager. You must create your own test program. public class
  • 3. Client{ public static void main (String args){ SystemManager res = new SystemManager(); //create airports res.createAirport(“YHZ”); res.createAirport(“YYZ”); res.createAirport(“YUL”); res.createAirport(“YVR”); res.createAirport(“YYC”); res.createAirport(“LONDON”); //invalid res.createAirport(“123”); //invalid res.createAirport(“YEG”); res.createAirport(“BOS”); res.createAirport(“JFK”); //create airlines res.createAirline(“AC”); res.createAirline(“DELTA”); res.createAirline(“USAIR”); res.createAirline(“WSJET”); res.createAirline(“FRONTIER”); //invalid //create flights res.createFlight(“AC”, res.createFlight(“AC”, res.createFlight(“AC”, res.createFlight(“AC”, “YHZ”, “YHZ”, “YUL”, “YUL”, “YUL”, “YYZ”, “YHZ”, “YVR”, “123”); “567”); “789”); “123”); //invalid – AC cannot have two flights with same id. res.createFlight(“AC”, “YHZ”, “YYZ”, “689”);
  • 4. res.createFlight(“DELTA”, “YHZ”, “BOS”, “123”); //etc. //create seats res.createSeats(“AC”, “123”, 40); res.createSeats(“DELTA”, “123”, 25); //etc. //find available flights res.findAvailableFlights(“YHZ”, “YYZ”); //book seats res.bookSeat(“AC”, “123”, 1, ‘A’); res.bookSeat(“AC”,“123”,20,‘F’); res.bookSeat(“AC”, “506”, 2, ‘B’); //invalid – 506 not created res.bookSeat(“AC”, “123”, 55, ‘C’); //invalid – row 55 doesn’t exist //display system details res.displaySystemDetails(); } } Submit your all your java files and sample outputs. ************************************************