-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTurnbull_FighterJet.java
89 lines (71 loc) · 2.28 KB
/
Turnbull_FighterJet.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//class that implements both AirVehicle and SoundBarrier interfaces
//includes variables, two constructors, getters and setters for all variables,
//a toString method, the three methods from Turnbull_AirVehicle interface,
//and the one method fromTurnbull_SoundBarrier interface
//
public class Turnbull_FighterJet implements Turnbull_AirVehicle, Turnbull_SoundBarrier {
//variables
public int numberOfEngines;
public int numberOfCrewMembers;
public String nameOfJet;
public String nameOfManu;
//constructors
public Turnbull_FighterJet() {
}
public Turnbull_FighterJet(int numberOfEngines, int numberOfCrewMembers,
String nameOfJet, String nameOfManu) {
this.numberOfEngines = numberOfEngines;
this.numberOfCrewMembers = numberOfCrewMembers;
this.nameOfJet = nameOfJet;
this.nameOfManu = nameOfManu;
}
//getters
public int getNumberOfEngines() {
return numberOfEngines;
}
public int getNumberOfCrewMembers() {
return numberOfCrewMembers;
}
public String getNameOfJet() {
return nameOfJet;
}
public String getNameOfManu() {
return nameOfManu;
}
//setters
public void setNumberOfEngines(int numberOfEngines) {
this.numberOfEngines = numberOfEngines;
}
public void setNumberOfCrewMembers(int numberOfCrewMembers) {
this.numberOfCrewMembers = numberOfCrewMembers;
}
public void setNameOfJet(String nameOfJet) {
this.nameOfJet = nameOfJet;
}
public void setNameOfManu(String nameOfManu) {
this.nameOfManu = nameOfManu;
}
//toString method
@Override
public String toString() {
return "Turnbull_FighterJet [numberOfEngines=" + numberOfEngines + ", numberOfCrewMembers="
+ numberOfCrewMembers + ", nameOfJet=" + nameOfJet + ", nameOfManu=" + nameOfManu + "]";
}
//implements methods from Turnbull_AirVehicle interface
@Override
public void avTakeOff() {
System.out.println(nameOfJet + " has started the takeoff roll.");
}
@Override
public void avFly() {
System.out.println(nameOfJet + " has taken off and is now flying.");
}
@Override
public void breakSoundBarrier() {
System.out.println(nameOfJet + " has broken the sound barrier!!!");
}
@Override
public void avLand() {
System.out.println(nameOfJet + " has successfully landed.");
}
}