-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.java
49 lines (32 loc) · 1.29 KB
/
main.java
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.io.File; // Import the File class
import java.io.FileNotFoundException;
import java.util.Scanner;
public class main {
public static void main(String[] args)throws Exception{
RR test1=new RR(3);
RR test2=new RR(5);
FCFS test3=new FCFS();
SJF test4=new SJF();
File myObj = new File("testdata1.txt");
Scanner myReader = new Scanner(myObj);
while (myReader.hasNextLine()){
if (myReader.hasNextInt()){
int t= myReader.nextInt();
test1.addRR(t);
test2.addRR(t);
test3.addFcfs(t);
test4.addSjf(t,0);
}
if (myReader.hasNextLine()){
myReader.nextLine();
}
}
test1.findavgTime();
System.out.println("***************************************************************************************");
test2.findavgTime();
System.out.println("***************************************************************************************");
test3.findavgTime();
System.out.println("\n***************************************************************************************");
test4.findavgTime();
}
}