Reference no: EM132208389
Write a program in c++ or java that simulates the FCFS (first-come, first-served), SJF (shortest-job-first), SRTF (shortest-remaining-time-first), RR (round-robin) and Priority CPU scheduling algorithms.
Create a separate Class for the jobs. Each job has a ID, Arrival time, Burst Time, and Priority.
Randomly generate the job details for 10 jobs (the ID's should be generated in a sequence i.e., ID#1, ID#2, ..., ID#10).
Arrival time should be between 0 and 10, Burst time between 1 and 20 seconds, and priority between 1 and 10 (lower value has higher priority i.e., 1 has more priority than 5).
For jobs with the same priority, give preference to arrival time.
For the RR scheduling, assume the time quantum or time slice to be 3 seconds. Execute the same set of jobs for each of the algorithms.
Report the average waiting time and average turnaround time for each scheduling algorithm. The program can be implemented either in C++ or Java.
Submit a pdf including screenshots of the program in execution. Include 2 runs of the program. please include the screenshots.