Question
In java please make is as simple as possible please Purpose: Write a program simulating a simple CPU scheduler to calculate average waiting time. Problem:
In java please make is as simple as possible please
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 ID | Priority | 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 (iii) 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. Notes: You may work with absolute values ignoring the time unit. That is, a process may have burst length 46 you may ignore whether it is 46 seconds or 46 milliseconds. This program may not need multithreading. Simple data structures (arrays, lists, etc.) should work.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started