Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions