-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
48 lines (34 loc) · 1.24 KB
/
main.java
File metadata and controls
48 lines (34 loc) · 1.24 KB
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
import java.io.IOException;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws IOException {
memoryAllocation sch= new memoryAllocation();
System.out.println("************* Table *************");
System.out.println("\n 1- First-Fit");
System.out.println("\n 2- Best-Fit ");
System.out.println("\n 3- Worst-Fit ");
System.out.println("\n************* Table *************");
Scanner scanner = new Scanner(System.in);
int select = 0;
while (select != 5) {
//sch.getinputs();
System.out.println("Please enter your choice: (1,2,3)");
select = scanner.nextInt();
if (select == 1) {
System.out.println("---- FIRST FIT -----");
sch.getinputs();
sch.firstFit();
}else if(select==2){
System.out.println("---- BEST FIT -----");
sch.getinputs();
sch.bestFit();
}else if(select == 3){
System.out.println("---- WORST FIT -----");
sch.getinputs();
sch.worstFit();
}else{
break;
}
}
}
}