Question: Task 1: Write a Java program to implement a Priority Queue in an office i. 11. 111. Provide the menu as shown below. Run the
Task 1: Write a Java program to implement a Priority Queue in an office i. 11. 111. Provide the menu as shown below. Run the program in a loop: stop when user opts 4. Use your own singly linked list of nodes with info request ID and priority. Add a customer should input priority (0 to 10) from user and enqueue it at proper position in the priority queue. Remove a customer should dequeue a customer with highest priority. Show the queue should display the queue using the method printQueue. 1V. V. Priority Queue Priority Queue Priority Queue Priority Queue Priority Queue 1. Add a customer 2 Remove a customer 3. Show the queue 4. Exit 1. Add a customer 2. Remove a customer 3. Show the queue 4. Exit 1. Add a customer 2. Remove a customer 3. Show the queue 4. Exit 1. Add a customer 2. Remove a customer 3. Show the queue 4 Exit 1. Add a customer 2. Remove a customer 3. Show the queue 4. Exit Your choice? 1 Your choice? 2 Your choice? 1 Your choice? 3 Erster priority? 7 Added customer #1 Your choice? 1 Removed customer #209) Enter priority? 9 Added customer #2 Queue 2 (9), (7), 3(1) Enter priority? 1 Added customer #3 Querak - 17), 3(1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
