Question: Write a program in either C or C++ that implements a Priority based Pre-emptive Scheduling Algorithm. Include tests that highlight the working of the algorithm.

Write a program in either C or C++ that implements a Priority based Pre-emptive Scheduling Algorithm. Include tests that highlight the working of the algorithm. the Algorithm is just a simulation, it will not be accessing real processes. You can assume a process to be a user-defined type which has CPU execution time, Arrival Time and Priority as fields. the user of your executable should be able to input processes along with their respective times and priorities. After every time unit, your program should printout the processes in the ready queue and the CPU status (idle/busy with process #). You do not have to use system time or "real" time. You can model time by a counter variable which increments inside a loop. Upload the source code, exe, any dependent required for compilation or running of your code (on Linux/Windows) and readmes (if any)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
