Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago