Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Abstract Data Types: Data Structures Design and implement an ADT that holds and manipulates the flight table. This table keeps all destinations and direct flights

Abstract Data Types: Data Structures

Design and implement an ADT that holds and manipulates the flight table. This table keeps all

destinations and direct flights between them.

The flight table should be composed of destinations in its rows and columns, and the ADT should

include:

A constructor which takes the destinations as input (as an array of destination names).

Modifiers that allow us to

add a flight from a specific destination to another specific one

remove a flight from a specific destination to another specific one

rename an existing destination

Inspectors that allow us to

determine whether flight table contains a specific destination

determine whether a destination is covered by any flights

determine the number of destinations that have flights

determine the number of flights

determine all destinations such that a direct flight exists from a specific destination to

there

determine all destinations such that a direct flight exists to a specific destination from

there

determine whether there is a direct flight from a specific destination to another one

display the current state of flight table in a 2D format

Please implement the ADT for Iztech Airlines Company. The company has a principle that all flights

must be bidirectional, i.e. when a flight is added/removed, the flight in the opposite direction will be

updated automatically. Additionally, the destination Izmir must exist by default and the company has

flights from Izmir to every other destination. Please note this company keeps its flight table with a

boolean representation of flights as follows: if there is a direct flight between Destination A and

Destination B, then the intersection point of them will be True, otherwise it should be False.

Please make sure that you implement the ADT as an interface in Java. The method names in the

interface should use destination and connection (instead of flight) words, so that the interface can also

be used for implementation of cruise table and bus table. Write a flight table class that implements

this interface. Provide also a separate test class (called FlightTableApp), which only contains the main

method to perform the following tasks:

creates a flight table using an array of destination names

adds some reasonable flights to the table

prints the current state of the flight table on the screen

tests all the above methods

IMPORTANT NOTES

1. We expect you provide a specification of the ADT and its implementer Flight Table, as a wellprepared

javadoc. The javadoc should contain an ADT description of the behavior of a

connections table and implemented behavior of this ADT as a Flight Table. Do not forget to

specify pre-conditions and post-conditions.

2. In your code, throw an appropriate exception whenever it is necessary

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

=+44-6 Discuss predictors of happiness and how we can be happier.

Answered: 1 week ago

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago