Question: Write the following in Java. Write a program to simulate following CPU scheduling algorithms 1) First Come First Serve (FCFS) 2) Shortest Job First (SJF)

Write the following in Java.

Write the following in Java. Write a program to simulate following CPU

Write a program to simulate following CPU scheduling algorithms 1) First Come First Serve (FCFS) 2) Shortest Job First (SJF) 3) Preemptive Priority Scheduling 4) Round Robin (RR) The task information will be read from an input file (input.txt) with the following format: Pid Arrival Time Burst Time Priority All of fields are integer type where Pid is a unique numeric process ID Arrival Time is the time when the task arrives in the unit of milliseconds Burst_Time is the CPU time requested by a task, in the unit of milliseconds Priority is the priority associated with each task with low numbers representing high priority Note: for RR algorithm you need to define a Time_quantum. What to do? Create a simple user interface to ask user for input.txt file, a scheduling algorithm and Time_quantum if RR is chosen. Print prog Once all tasks are completed, the program should compute and print ress of task every unit time (millisecond) o Average waiting time o Average response time o Average turnaround time o CPU utilization rate

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!