Repository navigation
Expand file tree
/
Copy pathTicket.java
More file actions
76 lines (65 loc) · 1.5 KB
/
Copy pathTicket.java
File metadata and controls
76 lines (65 loc) · 1.5 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
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package wk8proj;
/**
*
* @author Mohnani
*/
import java.time.LocalDate;
import java.text.SimpleDateFormat;
class Ticket {
//static long ticketNumber=101;
long id;
String category; // adult, child, senior
String holder;
LocalDate date;
double price;
boolean purchaseStatus ; //true=purchased false=reserved
Ticket(long id, String category, String holder, LocalDate date, double price, boolean purchaseStatus)
{
//ticketNumber=ticketNumber+1;
this.id=id;
this.category=category;
this.holder=holder;
this.date=date;
this.price=price;
this.purchaseStatus=purchaseStatus;
}
public void setPrice(double price)
{
this.price=price;
}
public void changePurchaseStatus(boolean purchaseStatus)
{
this.purchaseStatus=purchaseStatus;
}
public long getid()
{
return this.id;
}
public String getCategory()
{
return this.category;
}
public String getHolder()
{
return this.holder;
}
public String getDate()
{
//SimpleDateFormat df = new SimpleDateFormat("dd/MMM/yyyy");
String dateString = ""+this.date;
return (dateString);
}
public double getPrice()
{
return this.price;
}
@Override
public String toString() {
return(""+id+" "+category+" "+holder+" "+getDate()+" "+price+ " "+purchaseStatus);
}
}