Scenario Air Traffic Control oversees all the flight plans of the flights taking off from airports in their jurisdiction

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
correctanswer
Posts: 43759
Joined: Sat Aug 07, 2021 7:38 am

Scenario Air Traffic Control oversees all the flight plans of the flights taking off from airports in their jurisdiction

Post by correctanswer »

Scenario Air Traffic Control oversees all
the flight plans of the flights taking off from airports in their
jurisdiction. A flight plan includes the call sign of the
airplane and a list of all of the points on a route, including the
departure and the destination airports, in the order in which they
should be encountered (these points are
called waypoints).

A Waypoint has a name, a coordinate and
an altitude.

The class Waypoint (click to view this file) has already
been developed.

Please note that the answer box below
contains two classes to
complete. You can only use import statements at the
top of the answer box.
014c2665a7d74530aa5d9d1820c469c4 The answer box below
includes some methods of the class FlightPlan that you
should not alter, as well as the declarations for the fields of
the AirTrafficControl class.
(a) Develop only the class FlightPlan in this
part, which is already partially developed below.
(i) Add a declaration for a private instance variable
called route, which should be declared as
a ArrayList containing elements of
type Waypoint.
(ii) Add a public constructor for FlightPlan that
takes one string parameter representing the call sign of the
airplane and initialises the related variable accordingly. The
constructor should also initialise route to a suitable
empty collection.
(iii) Add a standard getter method for
the route collection.
(iv) Write a public instance
method greatestAltitude that has no parameters and
returns the altitude of the highest waypoint on the route of this
flight plan. You can assume that there are at least three
waypoints on the route.
(v) Write a public instance
method destination that returns the name of the
final waypoint on the route of this flight plan.
(vi) The air traffic controllers want to be able to sort flight
plans by their call signs in ascending order. Modify
the FlightPlan class so that it implements the
appropriate interface, and then implement
the compareTo method that will allow the ordering
required.
(b) Develop only the
class AirTrafficControl in this part, which is already
partially developed below.
(i) Add a public AirTrafficControl constructor that
initialises flightPlans to a suitable collection type
(initially empty).
(ii) Add a public method addFlightPlan that adds the
parameter, of type FlightPlan to flightPlans.
Nothing is returned from the method.
(iii) Add a public instance method routeMap that
returns a HashMap in which the keys are the call signs of
the flight plans and each value is an ArrayList of the
names of the waypoints on the corresponding route, in the order in
which they should be encountered.
Register for solutions, replies, and use board search function. Answer Happy Forum is an archive of questions covering all technical subjects across the Internet.
Post Reply