Question: import java.util.*; public class CPU_Scheduling{ //public static void main(String atgs[]){ Scanner sc = new Scanner(System.in); //System.out.println(enter no of process: ); int n = sc.nextInt(); int
import java.util.*; public class CPU_Scheduling{ //public static void main(String atgs[]){ Scanner sc = new Scanner(System.in); //System.out.println("enter no of process: "); int n = sc.nextInt(); int pid[] = new int[n]; // process ids int at[] = new int[n]; // atrival times int bt[] = new int[n]; // burst or execution times int ct[] = new int[n]; // completion times int ta[] = new int[n]; // turn atound times int wt[] = new int[n]; // waiting times int f[] = new int[n]; int k[]= new int[n]; int temp; int st=0, tot=0; float avgwt=0,avgta=0; public void FCFS(){ Scanner sc = new Scanner(System.in); System.out.println("enter no of process: "); int n = sc.nextInt(); for(int i = 0; i < n; i++) { System.out.println("enter process " + (i+1) + " atrival time: "); at[i] = sc.nextInt(); System.out.println("enter process " + (i+1) + " brust time: "); bt[i] = sc.nextInt(); pid[i] = i+1; } for(int i = 0 ; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
