-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNonUrgentOrder.java
More file actions
38 lines (34 loc) · 1.11 KB
/
Copy pathNonUrgentOrder.java
File metadata and controls
38 lines (34 loc) · 1.11 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
/**
* Write a description of class NonUrgentOrder here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class NonUrgentOrder extends Order
{
//CONSTRUCTOR DE LA SUBCLASE NonUrgentOrder
public NonUrgentOrder (String sendingName, Location location, Location destination, int deliveryTime,
double weight, String destinationName, Surcharge surcharge, Urgency urgency) {
super(sendingName, location, destination, deliveryTime,
weight, destinationName, surcharge, urgency);
}
/**
* @return The surcharge's value of the order.
*/
@Override
public int charge () {
return getSurcharge().getValue();
}
/**
* Return an integer number that the delivery person must increase to the order.
* @return An integer value.
*/
@Override
public int calculateEvaluationDP () {
return 5;
}
@Override
public String showInitialInfo(){
return super.showInitialInfo() + " <charge: " + getSurcharge().getName() + " (value: " + getSurcharge().getValue() + ")>";
}
}