-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
32 lines (28 loc) · 1.3 KB
/
Main.java
File metadata and controls
32 lines (28 loc) · 1.3 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
public class Main {
public static void main(String[] args){
// Test cases for a)
boolean[][] scheduleOne = new boolean[7][60];
for (int i = 10; i < 15; i ++) {scheduleOne[1][i] = true;}
for (int i = 30; i < 45; i ++) {scheduleOne[1][i] = true;}
for (int i = 50; i < 60; i ++) {scheduleOne[1][i] = true;}
AppointmentBook a = new AppointmentBook(scheduleOne);
System.out.println(a.findFreeBlock(2, 15));
System.out.println(a.findFreeBlock(2, 9));
System.out.println(a.findFreeBlock(2, 20));
//test cases for b)
boolean[][] scheduleTwo = new boolean[7][60];
for (int i = 24; i < 30; i++) {scheduleTwo[1][i] = true;}
for (int i = 0; i < 15; i++) {scheduleTwo[2][i] = true;}
for (int i = 40; i < 60; i++) {scheduleTwo[2][i] = true;}
for (int i = 4; i < 30; i++) {scheduleTwo[3][i] = true;}
for (int i = 43; i < 60; i++) {scheduleTwo[3][i] = true;}
AppointmentBook b = new AppointmentBook(scheduleTwo);
b.printBlock(4,4,29);
System.out.println(b.makeAppointment(2,4,22));
b.printBlock(4,4,29);
b.printBlock(3, 0, 2);
System.out.println(b.makeAppointment(3,4,3));
b.printBlock(3, 0, 2);
System.out.println(b.makeAppointment(2,4,30));
}
}