Write a program that can simulate the following CPU scheduling algorithms:
1. FCFS
2. RR (new processes are added at the beginning of the ready queue, the quantum is one time unit)
3. Priority based
4. SJF non-preemptive
5. SRTF
The program can be written in either C or Pascal. Although the platform for development can be one of your choice, the program must be portable (i.e. platform independent) and its final version must run correctly on the server of the computer science department where the grading will be performed.
Specifications:
1. The program must:
1. Ask the user for the name of a file containing its input data. The file will have the following format:
0. Number of processes.
1. A number of lines containing the data for each process. Each process will have one line which will contain in the following order: the burst time, the priority (the lower the number the higher the priority) and the arrival time.
2. The algorithm(s) required. The algorithm will be specified as one of: FCFS, RR, Priority, SJF, SRTF
This is an example of an input file (corresponding to exercise 5.3 page 150):
5
10 3 0
1 1 0
2 3 0
1 4 0
5 2 0
FCFS
SJF
Priority
RR
2. Calculate the Gantt diagram. The diagram will be displayed as follows:
0 -p1- 2 -p2- 5 -p3- 7
The example shows P1 running for 2 time units (from 0 to 2) then P2 running for 3 time units (from 2 to 5) then P3 running for 2 units (from 5 to 7).
3. Calculate the waiting time of each process and the average waiting time for the given algorithms.
my mail: << email address snipped>> plz send in my mail