-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunway.java
More file actions
39 lines (32 loc) · 845 Bytes
/
Copy pathRunway.java
File metadata and controls
39 lines (32 loc) · 845 Bytes
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
public class Runway {
private int landCount = 0;
private int departCount = 0;
private int name;
public Runway(int name) {
this.name = name;
}
public void printReport() {
System.out.println("Runway " + name + " has a total of "+ landCount + " landings.");
System.out.println("Runway " + name + " has a total of "+ departCount + " departures.");
System.out.println("Runway " + name + " has a combined total of "+ getCount() + " uses.");
}
public void inc(String status) {
if (status.equals("land")) {
landCount++;
} else {
departCount++;
}
}
public String getName() {
return "Runway " + name;
}
public int getLandCount() {
return landCount;
}
public int getDepartCount() {
return departCount;
}
public int getCount() {
return departCount + landCount;
}
}