ini codenya:
Code: import java.util.*; class RR { Scanner sc=new Scanner(System.in); int[] bur,rem,wai,ta; int size,q,b=0,t=0,flag=0; RR(int size) { this.size=size; bur=new int[size]; wai=new int[size]; ta=new int[size]; rem=new int[size]; } void get() { for(int i=0;i=q) { System.out.print("P"+(i+1)+"\t"); for(int j=0;j 0) wai[j]+=q; } } else if(rem[i]>0) { System.out.print("P"+(i+1)+"\t"); for(int j=0;j 0) wai[j]+=rem[i]; } } } for(int i=0;i 0) flag=1; }while(flag==1); for(int i=0;i
ini outputnya
OUTPUT
Enter the no of process:3
Enter burst time of P1:13
Enter burst time of P2:8
Enter burst time of P3:3
Enter quantum time:4
P1 P2 P3 P1 P2 P1 P1
Process Burst Waiting Turnaround
P1 13 11 24
P2 8 11 19
P3 3 8 11
Average waiting time:10
Average Turnaround time:18