Question: /* Implement a java program to simulate an air traffic control using a linked list (only insertions). This air traffic control must control all flights

/* Implement a java program to simulate an air traffic control using a linked list (only insertions). This air traffic control must control all flights (takeoffs and landings) on a specific airway.

Takeoff: Insert a new node (flight)

Landing: Remove the specific node (next class exercise).

The program should ask for the following information:

- Flight number (e.g. NAX7091)

- Origin (e.g. El Paso, Texas)

- Destination (e.g. Los Angeles, California)

- Airline name (e.g. American Airlines)

- Departure (e.g. Mon 02:00PM)

- Arrival (e.g. Mon 05:00PM)

Modify Aircraft.java file to include the variables. Remember that the Aircraft class must have a next variable.

Using a for loop, insert at least 5 flights.

Implement the printAirTraffic method to print the airway traffic (linked list). */

class Main{

public static void main (String[] arg){

Aircraft airway = null; //This is the head (the airway)

airway = new Aircraft(); // Creates an empty airway

Aircraft flight = airway;

//your code goes here

printAirTraffic(airway);

}

public static void printAirTraffic(Aircraft airway){

//Implement this method

}

}

class Aircraft{

String flightNumber;

Aircraft next;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!