The purpose of this project is to write a java program that simulates the CPU Scheduler (also known as Short-Term Scheduler) of an operating system.

The program implements the following CPU scheduling algorithms.

1. First-Come-First-Serve (FCFS)
2. Shortest-Job-First (SJF)
3. Round-Robin with time slice = 2 (RR-2)
4. Round-Robin with time slice = 5 (RR-5)

The program will read process burst times from a file (job.txt) - this file will be provided by the instructor.

A sample input file of four jobs is given as follows (burst time in ms).:

[Begin of job.txt]
Job1
5
Job2
3
Job3
8
Job4
6
[End of job.txt]

Note: You can assume that

(1) there are no more than 30 jobs in the input file (job.txt).
(2) processes arrive in the order they are read from the file for FCFS, RR-2 and RR-5.
(3) all jobs arrive at time 0 for SJF.

Compare the average completion times of all jobs for each scheduling algorithm. Output the details of each algorithm's execution. You need to show which jobs are selected at what times as well as their starting and stopping burst values. You can choose your display format, but it is recommended that you display the results in terms of a Gantt chart.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.