Write a program to implement various CPU scheduling algorithms. The input and output are described below:
Input:
The first line of the input represents the scheduling algorithm:
1 for FCFS
2 for shortest-job first
3 for shortest remaining time first
4 for priority scheduling
5 for round-robin scheduling
The second line of the input represents the number of processes.
The third line of the input contains the arrival time of the processes.
The fourth line represents the CPU burst times of the processes.
In the case of priority scheduling, the fifth line represents the priority of each process. Lesser the priority value, the higher the priority of the process.
In the case of round-robin scheduling, the fifth line contains the time quantum.
Output:
The first line of the output should be the waiting times of the processes separated by space.
The second line of the output should be the response times of the processes separated by space.
The third line of the output should be the turnaround times of the processes separated by space.
The fourth line of the output should be the throughput.
Turn-in:
You are asked to electronically turn in your source files (or a shell script). Attach a README file describing the names of your executables, the compiling instructions, or anything else special you want to let us know. The README file should be in plain text format. Instructions for electronic turn-in will be conveyed to you a few days before the deadline.