Question: ( This Must be in JAVA ) Purpose: Write a program to implement deterministic evaluation of CPU scheduling algorithms with the average waiting time criterion.

(This Must be in JAVA)
Purpose: Write a program to implement deterministic evaluation of CPU scheduling algorithms
with the average waiting time criterion.
Scheduler Sanpshot: 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 the process is created
iii) a priority between 1 and 10(low value indicates higher priority), randomly assigned
when the process is created (two or more processes may have same priority rank).
Requirement 1: Display initial snapshot of the system with the information of above 5 processes as
following tabular manner (order the entries in increasing ID number):
Process ID | Priority | Burst-length
RUBRIC: Correct values within the range (ID, burst length, priority)[3]
Non-duplicate ID [1]
Display of the initial snapshot (correct tabular format)[2]
Requirement 2: Now, allow user of the program to enter attributes (id, priority, and burst length) of
another process (the 6th one). Make sure the following are satisfied:
i) user may enter any integer as a process ID. Your program must check the appropriate
range (0 to 10). Also, user entered value should not be a duplicate of already created IDs.
Any of these violated, user must be notified and given chances to enter a valid ID.
ii) User may enter any integer as burst length. Your program must check the appropriate
range (20 to 100). If violated, user gets chances until an acceptable value is entered.
iii) User may enter any integer as a priority value. Your program must check the appropriate
range (1 to 10). If violated, user gets chances until an acceptable value is entered.
Display updated snapshot of the system (with 6 processes now) in the same format as above
(Requirement 1).
RUBRIC: Correct input acceptance implementation
Requirement 3:
Now, assuming all processes are ready for scheduling, calculate individual waiting time for each
process using the following algorithms: (i) Non-preemptive priority, and (ii) round robin with time
quantum 25.
Display the result as follows (in tabular form):
Process ID | Priority | Burst-length | Scheduling algorithm | Waiting time
The above snapshot display should be grouped by algorithm. That is, results from priority algorithm
followed by results from RR algorithm. For priority algorithm, results should display the records by
priority rank of the processes. For equal priority, choose the process with lower ID value. The round
robin algorithm should consider the processes in their ID order (lowest to highest). The display of
the result should also be in the ID order.
RUBRIC: Correct format, with ordering [4]
[4]
Correct implementation of the priority algorithm (tested by correct waiting time
values)
[10]
Correct implementation of the RR algorithm (tested by correct waiting time values)
[10]
Requirement 4: Based on your snapshot and calculations, also display average waiting time for
each algorithm.
RUBRIC: Correct average waiting time values [4]
Hints:
You can consider this coding as an implementation of Gnatt chart to calculate average
waiting time.
You do not need to create any actual process (that is, no need to use fork(0). Treat a process
as an object that has some attributes like ID, burst length, priority, etc. You may add other
attributes as you deem necessary.
You can work with absolute values ignoring the time unit. That is, a process may have burst
length 46- you can ignore whether it is 46 seconds or 46 milliseconds.
The RR scheduler selects the processes according to ID order (lowest to highest). The
priority scheduler selects the processes with highest priority first.
This program does not need multithreading. Simple data structures (arrays, lists, etc.) should
be sufficient to implement the scheduling algorithms.
 (This Must be in JAVA) Purpose: Write a program to implement

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!