-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerOnline.java
70 lines (60 loc) · 1.95 KB
/
CustomerOnline.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
67
68
69
70
/**
* @author Phichayut Ngoennim [6388035] >>> MAIN CONTRIBUTOR
* @author Jirayu Klinudom [6388085] >>> PROOF READ
* @author Perakorn Nimitkul [6388127] >>> PROOF READ
* Section 2
*
* @status >>>TASK 1 COMPLETED
* >>>TASK 5 COMPLETED
* >>>PROJECT CONCLUDED
* >>>CHALLENGE CONCLUDED
*
* @Note >>>Nothing much to say here just followed the instruction
* and run the test case successfully
* >>>Not much fixing to be made on Task 5
*/
public class CustomerOnline extends Customer{
//**************************** DO NOT MODIFY **********************************//
private double distance; // delivery distance
//*****************************************************************************//
/**
* Constructor initializes customer's name and delivery distance
* @param name
* @param distance
*/
public CustomerOnline(String name, double distance)
{
super(name);
this.distance = distance;
}
/**
* Constructor initializes customer's ID, name and delivery distance
* @param id
* @param name
* @param distance
*/
public CustomerOnline(int id, String name, double distance)
{
super(id,name);
this.distance = distance;
}
/**
*
* @return string containing info of an online customer
*/
@Override
public String log()
{
String dist = df.format(this.distance);
return super.getCustID() + "," + super.getName() + "," + dist;
}
//**************************** DO NOT MODIFY **********************************//
public double getDistance() {
return this.distance;
}
@Override
public String toString() {
return super.toString() + "," + distance;
}
//*****************************************************************************//
}