Given a partial main() and PlaneQueue class, write the push() and pop() methods for PlaneQueue. Then complete the main() to read in whether flights are arriving or have landed at an airport. An "arriving" flight is pushed onto the queue. A "landed" flight is popped from the front of the queue. Output the queue after each plane is pushed or popped. Entering -1 exits the program. Ex: If the input is: arriving AA213 arriving DAL23 arriving UA628 landed -1 the output is: Air-traffic control queue Next to land: AA213 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 UA628 AA213 has landed. Air-traffic control queue Next to land: DAL23 Arriving flights: UA628 JAVA Please
Given a partial main() and PlaneQueue class, write the push() and pop() methods for PlaneQueue. Then complete the main() to read in whether flights are arriving or have landed at an airport. An "arriving" flight is pushed onto the queue. A "landed" flight is popped from the front of the queue. Output the queue after each plane is pushed or popped. Entering -1 exits the program.
Ex: If the input is:
arriving AA213 arriving DAL23 arriving UA628 landed -1
the output is:
Air-traffic control queue Next to land: AA213 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 Air-traffic control queue Next to land: AA213 Arriving flights: DAL23 UA628 AA213 has landed. Air-traffic control queue Next to land: DAL23 Arriving flights: UA628
JAVA Please
Trending now
This is a popular solution!
Step by step
Solved in 2 steps