-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFly.java
66 lines (54 loc) · 1.56 KB
/
Fly.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
public class Fly{
private FirstClass firstClass ;
private EconomyClass economyClass;
private String company, date, time, gate, number, from, to;
private Double price;
public Fly(String company, String date, String time, String number, String gate, String from, String to, Double price){
this.company = company;
this.date = date;
this.time = time;
this.gate = gate;
this.number = number;
this.from = from;
this.to = to;
this.price = price;
this.firstClass = new FirstClass();
this.economyClass = new EconomyClass();
}
void print(){
System.out.println("================ Primeira Classe ================");
firstClass.print();
System.out.println("================ Classe Econômica ================");
economyClass.print();
}
FirstClass getFirstClass(){
return this.firstClass;
}
EconomyClass getEconomyClass(){
return this.economyClass;
}
String getCompany(){
return this.company;
}
String getDate(){
return this.date;
}
String getTime(){
return this.time;
}
String getGate(){
return this.gate;
}
String getNumber(){
return this.number;
}
String getFrom(){
return this.from;
}
public String toString(){
return date + " "+ time + "\t\tGATE :" +gate + "\t\tFlight nº: " + number + "\n\nFrom\t: "+from +"\t\t\t\t\t$"+price + "\n\nTo\t: " +to;
}
String getTo(){
return this.to;
}
}