Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 IDs 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions