Question: Java Help Description of Assignment Implementing the following CPU scheduling algorithms using Java with the assumption that all jobs are CPU bound and all given
Java Help
Description of Assignment
Implementing the following CPU scheduling algorithms using Java with the assumption that all jobs are CPU bound and all given at the same time.
First Come First Served (FCFS)
Non-Preemptive Shortest Job First (SJF)
Profile the performance of these algorithms by tracking the following measures of effectiveness which are defined below: The waiting time for a process reflects the total amount of time spent by that process in the ready queue. The average waiting time reports the average for the set of processes that were scheduled. The turnaround time for a process is the difference between a jobs submission and completion times. The average turnaround time reports the average for the set of processes that were scheduled.
Requirements of Task
1. You need to read the CPU Burst Time of processes for your scheduling algorithms from the keyboard as follows:
Please enter the CPU Burst Time for Process #1 (-1 to exit): 10
Please enter the CPU Burst Time for Process #2 (-1 to exit): 29
Please enter the CPU Burst Time for Process #3 (-1 to exit): 3
Please enter the CPU Burst Time for Process #4 (-1 to exit): 7
Please enter the CPU Burst Time for Process #5 (-1 to exit): 12
Please enter the CPU Burst Time for Process #6 (-1 to exit): -1
2. Your program (scheduler.java) should support these options: FCFS, SJF, Exit. Which scheduling algorithm would you like to use? (FCFS, SJF, Exit): FCFS
Implement FCFS and report sequence of execution (begin time and end time for each process CPU burst), average waiting time and average turnaround time.
========================================== FCFS SCHEDULING ALGORITHM: ==========================================
PID Start Burst End Burst
1 0 10
2 10 39
3 39 42
4 42 49
5 49 81 Average waiting time: 28.00
Average turnaround time: 40.20 ==========================================
Which scheduling algorithm would you like to use? (FCFS, SJF, Exit): Exit
4. Implement SJF (non-preemptive) and report sequence of execution (begin time and end time for each process CPU burst), average waiting time and average turnaround time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
