Question: Task 1: Write a Java program to implement a Priority Queue in an office i. iii. Provide the menu as shown below. Run the program

 Task 1: Write a Java program to implement a Priority Queue

Task 1: Write a Java program to implement a Priority Queue in an office i. iii. 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 requestID 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(). IV. V. Priority Queue Priority Queue Priority Queue Priority Quelle 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. Sbow 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 Your choice? 1 Enter priority? 7 Added customer #1 Removed customer #2(9) Enter priority? Added customer #2 Queue-2 (9), 17), 3(1) Enter priority? 1 Added customer #3 Queue - 17),3(1)

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!