-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
30 lines (26 loc) · 868 Bytes
/
Test.java
File metadata and controls
30 lines (26 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.ArrayList;
import java.util.Scanner;
public class Test {
public static void main(String[] args) throws CloneNotSupportedException {
SJFScheduler myScheduler =new SJFScheduler();
Scanner scan = new Scanner(System.in);
System.out.println("Enter the total no of processes: ");
int totalProcessNumber=scan.nextInt();
ArrayList<Process> Processes =new ArrayList<Process>();
int i,pArrival,pBurst;
String pName;
for(i=0;i<totalProcessNumber;i++) {
scan.nextLine();
System.out.println("Enter p_name: ");
pName=scan.nextLine();
System.out.println("Enter p_arrival: ");
pArrival=scan.nextInt();
System.out.println("Enter p_burst: ");
pBurst=scan.nextInt();
Process a=new Process(pName,pArrival,pBurst);
Processes.add(a);
}
myScheduler.Schedule(Processes);
scan.close();
}
}