Can you please help me with this code because i am struggling on how to do this, this code has to be in C code. question that i need help with: Priority with round-robin schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. There will be multiple queues in the system each representing one priority class. For ease of implementation, you need total 1 through max_priority numbers of queues. You should start scheduling job out of the max priority queue and serve the members of the queue following RR. The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format: T1, 4, 20 T2, 2, 25 T3, 3, 25 T4, 3, 15 T5, 10, 10 The output should look like this: Running task = [P1] [4] [5] for 5 units. Task P1 finished. Running task = [P5] [3] [4] for 4 units. Task P5 finished. Running task = [P4] [2] [7] for 1 units. Task P4 exhausted its Quantum hence will be Rescheduled. Running task = [P3] [2] [1] for 1 units. Task P3 finished. Running task = [P4] [2] [6] for 6 units. Task P4 finished. Running task = [P2] [1] [3] for 3 units. Task P2 finished.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
icon
Concept explainers
Question

Can you please help me with this code because i am struggling on how to do this, this code has to be in C code.

question that i need help with:
Priority with round-robin schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. There will be multiple queues in the system each representing one priority class. For ease of implementation, you need total 1 through max_priority numbers of queues. You should start scheduling job out of the max priority queue and serve the members of the queue following RR.

The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format:

T1, 4, 20
T2, 2, 25
T3, 3, 25
T4, 3, 15
T5, 10, 10
The output should look like this:

Running task = [P1] [4] [5] for 5 units.

Task P1 finished.

Running task = [P5] [3] [4] for 4 units.

Task P5 finished.

Running task = [P4] [2] [7] for 1 units.

Task P4 exhausted its Quantum hence will be Rescheduled.

Running task = [P3] [2] [1] for 1 units.

Task P3 finished.

Running task = [P4] [2] [6] for 6 units.

Task P4 finished.

Running task = [P2] [1] [3] for 3 units.

Task P2 finished.

 
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Depth First Search
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning