-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathVisit.java
More file actions
49 lines (39 loc) · 1.02 KB
/
Visit.java
File metadata and controls
49 lines (39 loc) · 1.02 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
package src.ex7;
import java.util.Date;
/**
* The Discount System: Visit.
*/
public class Visit
{
private Customer customer;
private Date date;
private double serviceExpense;
private double productExpense;
public Visit(String name, Date date)
{
this.customer = new Customer(name);
this.date = date;
}
public String getName() {
return customer.getName();
}
public double getServiceExpense() {
return serviceExpense;
}
public void setServiceExpense(double ex) {
serviceExpense = ex;
}
public double getProductExpense() {
return productExpense;
}
public void setProductExpense(double ex) {
productExpense = ex;
}
public double getTotalExpense() {
return serviceExpense + productExpense;
}
public String toString() {
return String.format("Visit of customer %1$s at date %2$s"
, customer.toString(), date.toString());
}
}