-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeat.java
More file actions
50 lines (46 loc) · 1.11 KB
/
Copy pathSeat.java
File metadata and controls
50 lines (46 loc) · 1.11 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
49
50
import org.junit.Test;
/**
* Class to manage seats on a plane
* @author Benjamin Singleton
*/
class Seat {
private String seating;
private boolean available;
/**
* Sets local variables to passed in parameters
* @param seating The row and column of the seat (ex. "1A")
* @param available Is the seat available
*/
public Seat (String seating, boolean available) {
this.seating = seating;
this.available = available;
}
public Seat() {
this.seating = "1A";
this.available = false;
}
//Getters
public String getSeating() {
return seating;
}
public boolean isAvailable() {
return available;
}
// Setters
public void setSeating(String seating) {
this.seating = seating;
}
public void setAvailable(boolean available) {
this.available = available;
}
/**
* Checks if the seat is available and returns
* a proper display based on availability
*/
public String toString() {
if (available) {
return "|_|";
}
return "|*|";
}
}