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 (i.e., process)
ii. An array for the arrival times, data type int (i.e., at)
iii. An array for the burst times, data type int (i.e., bt)
c. Declare an array for the wait times, data type int (i.e., wt)
d. Declare an array for the turnaround times, data type int (i.e., tat)
e. Initialize index 0 in array wt to 0
h. Calculate the wait times for each process
i. Iterate for the number of processes (i.e.,
PID
) starting at
index 1
1.
Set the wait time in array wt at the current index
equal to the sum of burst time (i.e., bt) of the
previous i
ndex and wait time (i.e.,
w
t
) of the
previous index
i. Calculate the turnaround times for each process
i. Iterate for the number of processes (i.e.,
PID
)
1.
Set the turnaround time in array ta
t at the current
index equal to the sum of burst time (i.e., bt) of the
current
i
ndex and wait time (i.e.,
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!