forked from wevertor/AirTicketManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFirstClass.java
33 lines (29 loc) · 844 Bytes
/
FirstClass.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
import java.util.*;
public class FirstClass extends Class{
FirstClass(){
sitMap = new int[5][];
for(int i = 0; i<5; i++){
sitMap[i] = new int[6];
}
}
/* if sitIsEmpty == true, then add Passenger in hashmap */
boolean sitIsEmpty(int x, int y){
if((x>=0 && x<=4)&&(y>=0 && y<=5)){ //if the position exists
if(sitMap[x][y] == 0){ //if the sit is empty
return true;
}
}
return false;
}
void print(){
System.out.println(" A B C D E F");
for(int i = 0; i<5; i++){
System.out.printf("%d ", i+1);
for(int j = 0 ; j<6 ; j++){
System.out.printf("%d ", sitMap[i][j]);
}
System.out.printf("\n");
}
System.out.printf("\n");
}
}