-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommonDP.java
More file actions
38 lines (32 loc) · 882 Bytes
/
Copy pathCommonDP.java
File metadata and controls
38 lines (32 loc) · 882 Bytes
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 CommondDP here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class CommonDP extends DeliveryPerson implements PopularEnRedes
{
private int popularEnRedes;
public CommonDP (DeliveryCompany company, Location location, String name){
super(company, location, name, 4);
popularEnRedes = 6;
}
public void setPopularEnRedes(){
if(getFirstOrder().getUrgency().getValue() == 3 ){
popularEnRedes = popularEnRedes + 4;
}
else{
popularEnRedes = popularEnRedes + 1;
}
}
@Override
public void deliverOrder()
{
setPopularEnRedes();
super.deliverOrder();
}
@Override
public String showFinalInfo(){
return super.showFinalInfo() + " - popularity: " + popularEnRedes;
}
}