Question: Write in Java Purpose: Write a program simulating a simple CPU scheduler to calculate average waiting time. Problem: Initial ready queue has 5 processes where

 Write in Java Purpose: Write a program simulating a simple CPU

Write in Java

Purpose: Write a program simulating a simple CPU scheduler to calculate average waiting time. Problem: Initial ready queue has 5 processes where each process has the following attributes i) an identifier (value between 0 and 10, randomly assigned - however, no two processes can have the same id); ii) a burst length between 20 100, randomly assigned when it is created; iii) a priority between 1 and 10 (low value indicates higher priority), randomly assigned when it is created (two or more processes may have same priority rank) Requirement: Display initial snapshot of the system as follows: Process IDPriority I Burst-length Allow user of the program to enter attributes of another process (make sure to have proper check for duplicate process ID). If duplicate ID entered, allow user to enter a correct (unique) process ID. Display updated snapshot of the system in the same format as above. Assuming all processes are ready for scheduling, calculate individual waiting time for each process and average waiting time, using the following algorithms: (i) Non-preemptive SJF, (ii) Non-preemptive priority, and (ii) round robin with time quantum 20. Display the result as follows: Process ID Priority | Burst-length Scheduling algorithm Total waiting time Based on your snapshot and calculations, also display average waiting time for each algorithm and order the algorithms from lowest to highest average waiting time

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!