Question: Write function displaySchedule to do the following a . Return type void b . Parameter list i . An array for the process IDs, data
Write function displaySchedule to do the following
a Return type void
b Parameter list
i An array for the process IDs, data type int ie process
ii An array for the arrival times, data type int ie at
iii. An array for the burst times, data type int ie bt
iv An array for the waiting times, data type int ie wt
v An array for the turnaround times, data type int ie tat
c Declare a variable for the total wait times, data type int, initialized
to ie totWt
d Declare a variable for the total turnaround times, data type int,
initialized to ie totTat
e Declare a variable for the average wait times, data type float,
initialized to ie avgWt
Declare a variable for the average turnaround times, data type float,
initialized to ie avgTat
g Iterate for the number of processes ie PID
i Set variable totWt equal to totWt plus the wait time in array
wt at the current index
ii Set variable totTat equal to totTat plus the wait time in array
tat at the current index
iii. Display to the console the process data from arrays process,
at bt wt and tat at the current index
h Calculate average wait time and display to the console ie avgWt
i Calculate average turnaround time and display to the console ie
avgTat
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
