Question: 1. Write a java program that will simulate First Come First Serve, Shortest Job Next, Shortest Remaining Time and Round Robin scheduling algorithms. For each

1. Write a java program that will simulate First Come First Serve, Shortest Job Next, Shortest Remaining Time and Round Robin scheduling algorithms. For each algorithm the program should compute waiting time and turnaround time of every job as well as the average wait time and average turnaround time. The average values should be consolidated in a table for easy comparison. Also the time quantum for Round Robin should be 4 ms (context switching time can be 0). You may use the following data to test your program:

Job Arrival Time CPU Cycle in ms
a 0 16
b 3 2
c 5 11
d 9 6
e 10 1
f 12 9
g 14 4
h 16 14
i 17 1
j 19 8

2. Modify the program from part 1 to generate a random job and change the context switching time to 0.4 ms. Compare outputs from both runs and discuss which would be a better policy. Describe any drastic changes encountered and explain why if there are some.

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!