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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started