-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvoice.java
More file actions
45 lines (39 loc) · 1.13 KB
/
Copy pathInvoice.java
File metadata and controls
45 lines (39 loc) · 1.13 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
class Invoice
{
int invoiceNum;
int date;
int participants;
String customerName;
char packCode;
double price, total, discount;
public Invoice (int i, int d, String c, char p, double harga, int parti)
{
invoiceNum = i;
date = d;
customerName = c;
packCode = p;
price = harga;
participants = parti;
}
public char getPackCode(){return packCode;}
public int getInvoiceNum(){return invoiceNum;}
public int getDate(){return date;}
public String getCustomerName(){return customerName;}
public double getPrice(){return price;}
public double getTotal(){return total;}
public int getParticipants(){return participants;}
public double grandTotal()
{
if (participants<14)
discount = 1.0;
else if(participants>=14 && participants>=40)
discount = 0.9;
else if(participants>40)
discount = 0.85;
total= price*participants*discount;
return total;
}
public String toString() {
return"Invoice Statement";
}
}