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 (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)
iv. An array for the waiting times, data type int (i.e., wt)
v. An array for the turnaround times, data type int (i.e., tat)
c. Declare a variable for the total wait times, data type int, initialized
to 0(i.e., totWt)
d. Declare a variable for the total turnaround times, data type int,
initialized to 0(i.e., totTat)
e. Declare a variable for the average wait times, data type float,
initialized to 0(i.e., avgWt)
Declare a variable for the average turnaround times, data type float,
initialized to 0(i.e., avgTat)
g. Iterate for the number of processes (i.e., 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 (i.e., avgWt)
i. Calculate average turnaround time and display to the console (i.e.,
avgTat)

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!