Question: Create a simple Java program that implements Queues. 1. The queue should have a maximum of 10 elements. 2. The user should see a simple

Create a simple Java program that implements Queues. 1. The queue should have a maximum of 10 elements. 2. The user should see a simple introduction message: "Welcome to Queues Program!" 3. The contents of the queue will be displayed. 4. The pointers for first and last will then be displayed. The first/front pointer should be at -1 while the last/rear pointer at 0 when the queue is empty. **When the queue is full the pointer will be the same. 5. The user will be given an option to select whether to enqueue, dequeue or exit. 6. If the user selects Dequeue, the program will remove the element at the front of the queue. and loops back to step 3. ** If the user selects Dequeue and the queue is empty, the program should tell the user that the queue is empty and loops back to step 5. ** If the user selects Queue, the program will ask for an input and adds this input to the back of the queue then loops back to step 3. **If the user selects Queue and the queue is full, the program should tell the user that the queue is full and loops back to step 5. **If the user selects Exit, the program will ask the user if they really wants to exit or not. If the user confirms, the program closes. If the user denies, the program loops back to step 3. **Please use of the main method only.

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!