Question: I need help programming this question in java. Write a program that simulates the behavior of the following four scheduling algorithms: FCFS, SJF, SRT, RR.

 I need help programming this question in java. Write a program

I need help programming this question in java.

that simulates the behavior of the following four scheduling algorithms: FCFS, SJF,

Write a program that simulates the behavior of the following four scheduling algorithms: FCFS, SJF, SRT, RR. The program input must be like the following: Enter the number of processes (the processes will be named p1, p2, p3 and so on) Enter the arrival time of each process in the system. Enter the CPU burst time of each process. Enter the time quantum for the RR scheduling. The output of the program will be the following: For each algorithm, the program will calculate the timing sequence of each process. For each algorithm, the program will output the individual wait time for each process and the overall average waiting time. For each algorithm, the program will output the individual turnaround time for each process and the overall average turnaround time. HW1 Test Case Input: Arrival Time Processes P1 P2 Arrival Time 0 CPU Time 5 2 2 P3 P4 3 5 6 3 RR Time Quantum = 3 units Output: FCFS: P1 0-5, P2 5-7, P3 7-13, P4 13-16 SJF: P1 0-5, P2 5-7, P4 7-10, P3 10-16 SRT: P1 0-2, P2 2-4, P1 4-7, P4 7-10, P3 10-16 RR: P1 0-3, P2 3-5, P1 5-7, P3 7-10, P4 10-13, P3 13-16 Wait Time: SRT RR 2 1 Processes P1 P2 P3 P4 Average Wait FCFS 0 3 4 8 3.75 SJF 0 3 7 2 3 2 0 7 2 2.75 7 5 3.75 Turnaround Time: Processes FCFS 5 5 SRT 7 2 RR 7 3 P1 P2 P3 P4 Average Turnaround SJF 5 5 13 5 7 10 13 11 7.75 5 6.75 13 8 7.75 Write a program that simulates the behavior of the following four scheduling algorithms: FCFS, SJF, SRT, RR. The program input must be like the following: Enter the number of processes (the processes will be named p1, p2, p3 and so on) Enter the arrival time of each process in the system. Enter the CPU burst time of each process. Enter the time quantum for the RR scheduling. The output of the program will be the following: For each algorithm, the program will calculate the timing sequence of each process. For each algorithm, the program will output the individual wait time for each process and the overall average waiting time. For each algorithm, the program will output the individual turnaround time for each process and the overall average turnaround time. HW1 Test Case Input: Arrival Time Processes P1 P2 Arrival Time 0 CPU Time 5 2 2 P3 P4 3 5 6 3 RR Time Quantum = 3 units Output: FCFS: P1 0-5, P2 5-7, P3 7-13, P4 13-16 SJF: P1 0-5, P2 5-7, P4 7-10, P3 10-16 SRT: P1 0-2, P2 2-4, P1 4-7, P4 7-10, P3 10-16 RR: P1 0-3, P2 3-5, P1 5-7, P3 7-10, P4 10-13, P3 13-16 Wait Time: SRT RR 2 1 Processes P1 P2 P3 P4 Average Wait FCFS 0 3 4 8 3.75 SJF 0 3 7 2 3 2 0 7 2 2.75 7 5 3.75 Turnaround Time: Processes FCFS 5 5 SRT 7 2 RR 7 3 P1 P2 P3 P4 Average Turnaround SJF 5 5 13 5 7 10 13 11 7.75 5 6.75 13 8 7.75

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!