cs211 lab2
http://www.maths.nuigalway.ie/~gettrick/teach/cs211/
-
For this lab you must write code (python
files), and, if applicable, the result(s) of running the program on (a few)
test cases. This
will be graded only in person in the lab.
The source code must
be well presented (indenting, spaces, reasonable variable/function names,
etc.) and must include comments (as a rough guideline - aim to have nearly as
many comments as lines of code). Any questions asked should be answered by
typing the answers into a comments section (using the hash tag) in your
PYTHON code.
-
Plagiarism (the unattributed copying of work from other sources
(internet, chatGPT, fellow students,....)) will not be tolerated.
You risk getting zero for your lab if it is found to be
plagiarized.
-
Check the file "criteria.pdf" to see what to look for, and what you
should take care of, in your PYTHON code.
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
-
Shortest Remaining Time First
-
Round Robin (with CPU slices of 4 seconds)
Test your program on the process durations [5,12,3,2,7,6,4,10,9]
and [2,9,8,13,4,5,11,6,9,10] and report the results in both cases for
the times (a) and (b)
©
University of Galway