cs211 lab2
http://www.maths.nuigalway.ie/~gettrick/teach/cs211/2024/labs/
-
For this lab you must submit all source code (python
files), and, if applicable, the result(s) of running the program on (a few)
test cases. This should be sent in as a file upload/attachment via CANVAS (not directly by email).
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 the relevant box on the CANVAS upload form, or
by including the answer in comments in the PYTHON source code..
-
This material should be uploaded
before
the deadline of 5pm
Friday February 16th., 2024. You will lose 20% for each day
(or part of day) the lab is late.
-
Plagiarism (the unattributed copying of work from other sources
(internet, fellow students,....)) will not be tolerated.
You risk getting zero for your lab if it is found to be
plagiarized.
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 Job First
-
Round Robin (with CPU slices of 5 seconds)
Test your program on the process durations [5,12,3,2,7,6,8,10,9]
and [2,9,8,13,4,5,11,6,2,10] and report the results in both cases for
the times (a) and (b) (submit these results in CANVAS when uploading your
program).
©
University of Galway