Question: Java language Don't copy others' answers new code needed to be provided. Program Specifications: Implement a double ended queue (deque) according to the interface given

Java language

Don't copy others' answers new code needed to be provided.

Program Specifications:

Implement a double ended queue (deque) according to the interface given using doubly linked nodes and simulate a simple airport with the following rules:

There are 2 runways

Create a menu that allows the user to

  • Approve the next plane to take off

The airplanes alternate between runways - unless one runway is empty

  • Can override the normal logic and approve the last plane on either of the runways to take off next

Deque Interface:/* Based on java.util.Deque interface https://docs.oracle.com/javase/7/docs/api/java/util/Deque.html */ public interface Deque { /** * Inserts the specified element at the front of this deque unless it would * violate capacity restrictions. hen using a capacity-restricted deque, * * @param e the element to add * @return {@code true} if the element was added to this deque, else * {@code false} */ boolean offerFirst(E e); /** * Inserts the specified element at the end of this deque unless it would * violate capacity restrictions. hen using a capacity-restricted deque, * * @param e the element to add * @return {@code true} if the element was added to this deque, else * {@code false} */ boolean offerLast(E e); /** * Retrieves and removes the first element of this deque, * or returns {@code null} if this deque is empty. * * @return the head of this deque, or {@code null} if this deque is empty */ E pollFirst(); /** * Retrieves and removes the last element of this deque, * or returns {@code null} if this deque is empty. * * @return the tail of this deque, or {@code null} if this deque is empty */ E pollLast(); /** * Retrieves, but does not remove, the first element of this deque, * or returns {@code null} if this deque is empty. * * @return the head of this deque, or {@code null} if this deque is empty */ E peekFirst(); /** * Retrieves, but does not remove, the last element of this deque, * or returns {@code null} if this deque is empty. * * @return the tail of this deque, or {@code null} if this deque is empty */ E peekLast(); /** * Returns the number of elements in this deque. * * @return the number of elements in this deque */ int size(); }Sample output:

Runway1: AA1111, AA2222, AA3333, AA4444

Runway2: AA5555, AA6666

### MENU ###

1. pprove next plane

2. mergency override from Runway 1

3. mergency override from Runway 2

Enter choice (1-3): 1

Taking off from Runway 1: AA1111

Runway1: AA2222, AA3333, AA4444

Runway2: AA5555, AA6666

### MENU ###

1. pprove next plane

2. mergency override from Runway 1

3. mergency override from Runway 2

Enter choice (1-3): 1

Taking off from Runway 2: AA5555

Runway1: AA2222, AA3333, AA4444

Runway2: AA6666

### MENU ###

1. pprove next plane

2. mergency override from Runway 1

3. mergency override from Runway 2

Enter choice (1-3): 1

Taking off from Runway 1: AA2222

Runway1: AA3333, AA4444

Runway2: AA5555, AA6666

### MENU ###

1. pprove next plane

2. mergency override from Runway 1

3. mergency override from Runway 2

Enter choice (1-3): 2

Taking off from Runway 1: AA4444

Runway1: AA3333, AA4444

Runway2: AA5555, AA6666

### MENU ###

1. pprove next plane

2. mergency override from Runway 1

3. mergency override from Runway 2

Enter choice (1-3): ...

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 Programming Questions!