Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A set of processes (lets say n of them, denoted by P1,P2,,Pn ) is sent to a CPU. The processes arrive in the order given,
A set of processes (lets say n of them, denoted by P1,P2,,Pn ) is sent to a CPU. The processes arrive in the order given, at times t=0,t=1,t=n. The duration (in seconds) of these processes is given ( d1, d2,.dn ). Write a PYTHON program which reads in these durations as input data from the user, and which calculates (a) the average waiting time and (b) the average turnaround time for the processes. These two numbers should be calculated for the scheduling policies of 1. Shortest Job First 2. Round Robin (with CPU slices of 5 seconds) Test your program on the process durations [5,12,1,6,7,6,4,10,12] and [2,9,11,3,4,2,11,1,5,10] and report the results in both cases for the times (a) and (b) above (submit these results in BB when uploading your program)
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