Question: Write function fcfs to do the following a . Return type void b . Parameter list i . An array for the process IDs, data
Write function fcfs 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
c Declare an array for the wait times, data type int ie wt
d Declare an array for the turnaround times, data type int ie tat
e Initialize index in array wt to
h Calculate the wait times for each process
i Iterate for the number of processes ie
PID
starting at
index
Set the wait time in array wt at the current index
equal to the sum of burst time ie bt of the
previous i
ndex and wait time ie
w
t
of the
previous index
i Calculate the turnaround times for each process
i Iterate for the number of processes ie
PID
Set the turnaround time in array ta
t at the current
index equal to the sum of burst time ie bt of the
current
i
ndex and wait time ie
w
t
of the current
index
j Call function displaySchedule passing arguments
i Array process
ii Array at
iii. Array bt
iv Array wt
v Array tat
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
