-
Notifications
You must be signed in to change notification settings - Fork 701
Expand file tree
/
Copy pathTicket.java
More file actions
40 lines (30 loc) · 770 Bytes
/
Ticket.java
File metadata and controls
40 lines (30 loc) · 770 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
40
package _02_05b;
public class Ticket {
public Ticket() {
}
private String destination;
private double price;
private boolean isReturn;
// Add three public methods to set the value of each field, called
// setDestination, setPrice and setIsReturn.
public void setDestination(String destination){
this.destination= destination;
}
public void setPrice(double price){
this.price=price;
}
public void setIsReturn(boolean isReturn){
this.isReturn=isReturn;
}
//Add three public methods to get the value of each field, called
// getDestination, getPrice and getIsReturn.
public String getDestination(){
return destination;
}
public double getPrice(){
return price;
}
public boolean getIsReturn(){
return isReturn;
}
}