Short Answer: CPU Scheduling Implement a function called compute_stats (defined below) that calculates and displays the Average Waiting Time (AWT) and Average Turnaround Time (ATT) for a schedule. Example: input containing (P3, 2), (P0, 3) would display AWT: 1 and ATT: 3.5. The function takes two arguments: an array that stores a schedule (see struct below) and the number of process bursts in that schedule. Already given are two lines that display the computed results. Already included is stdio.h, do not use any other headers. Assume that the contents of the array are already sorted per some scheduling algorithm. #include struct burst { int process_id; //shouldn’t be needed int size; }; void compute_stats(struct burst schedule[], int count) { //TODO: write this code printf(“AWT: %f ATT: %f\n”, awt, att); } void main() { //example usage. do not hard code for this! struct burst processes[2]; processes[0].process_id = 3; processes[0].size = 2; processes[1].process_id = 0; processes[1].size = 3; compute_stats(processes, 2); }
Blog
Q2.jpg Identify A [BLANK-1]
Q2.jpg Identify A [BLANK-1]
Q38.jpg Identify A [BLANK-1]
Q38.jpg Identify A [BLANK-1]
Q4.jpg Identify A [BLANK-1]
Q4.jpg Identify A [BLANK-1]
Practical1Pic24.png Identify A [BLANK-1]
Practical1Pic24.png Identify A [BLANK-1]
Q3.jpg Identify A [BLANK-1]
Q3.jpg Identify A [BLANK-1]
Q23.jpg Identify A [BLANK-1]
Q23.jpg Identify A [BLANK-1]
Screenshot 2023-12-01 at 11.12.03 PM.png
Screenshot 2023-12-01 at 11.12.03 PM.png
Screenshot 2023-12-01 at 11.10.51 PM.png
Screenshot 2023-12-01 at 11.10.51 PM.png
Practical1Pic37.png Identify A [BLANK-1]
Practical1Pic37.png Identify A [BLANK-1]