Question: Wrtie C program for a scheduler using either FIFO, SJF, SRT, RR, and Priority, we will read an input file (prompt for the name of

Wrtie C program for a scheduler using either FIFO, SJF, SRT, RR, and Priority, we will read an input file (prompt for the name of the file) where the input will be formatted as (with parameters on the same line separated by a space): ProcID ArrivalTime RunTime Priority

The ProcID is a C-string that can hold 20 characters and the others are integers, which serve to represent cycles

Sample Input file using FIFO:

P0 0 350 0 P1 0 125 0 P2 0 475 0 P3 0 250 0 P4 0 75 0

Wrtie C program for a scheduler using either FIFO, SJF, SRT, RR,

and Priority, we will read an input file (prompt for the name

Output:

of the file) where the input will be formatted as (with parameters

#include #include int initialize(); int p[10],a[10],b[10],w[10],ta[10],t1; void main() { int i,j,n,t,sum=0; float aw,at,sum1; clrscr(); printf(" P A B W TAT "); n=initialize(); for(i=0;ia[j]) { t=a[i]; a[i]=a[j]; a[j]=t; t=b[i]; b[i]=b[j]; b[j]=t; t=p[i]; p[i]=p[j]; p[j]=t; } } } t1=a[0]; for(i=0;i Here, all processes arrive at the same time (no priority is used). Each file may support up to 50 processes being specified. You may assume that input is sorted by arrival time this means that the arrival time of pi +1 pi

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!