Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a java program for uniprocessor scheduling for the following, Uniprocessor

ID: 3814142 • Letter: W

Question

write a java program for uniprocessor scheduling for the following,

Uniprocessor Policies

– First-Come-First-Served (FCFS)

– Round Robin (RR)

– Shortest Process Next (SPN)

– Shortest Remaining Time (SRT)

– Highest Response Ratio Next (HRRN)

The input file for Uniprocessor Scheduling shoud look like this:

U,5,4

A,0,3

B,2,6

C,4,4

D,6,5

E,8,2

The first line specifies the type of scheduling (U for uniprocessor), the number of processes to be scheduled (5), and the quantum for Round Robin scheduling (4).

The remaining lines specify the characteristics of one process per line in the following format: Process,Arrival Time,Service Time

The output for the input file shown above should look like this:

FCFS:

A:0->3

B:3->9

C:9->13

D:13->18

E:18->20

RR: A:0->3

B:3->7
C:7->11

D:11->15

B:15->17

E:17->19

D:19->20

SPN:

A:0->3

B:3->9

E:9->11

C:11->15

D:15->20

SRT:
A:0->3

B:3->4

C:4->8

E:8->10

B:10->15

D:15->20

HRRN:

A:0->3

B:3->9

C:9->13

E:13->15

D:15->20

For each of the policies listed in the Introduction output the abbreviation, then a line for each change in actively running process. The first line from the FCFS section above: A:0->3 indicates that process A runs from time 0 to time 3.

Explanation / Answer

Added code for first come first serve and Round robin