Repository navigation
Expand file tree
/
Copy pathBlueCrossBlueShield.java
More file actions
62 lines (58 loc) · 1.64 KB
/
Copy pathBlueCrossBlueShield.java
File metadata and controls
62 lines (58 loc) · 1.64 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
50
51
52
53
54
55
56
57
58
59
60
61
62
package src;
public class BlueCrossBlueShield implements InsuranceBrand{
private long id;
private String name;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public double computeMonthlyPremium(HealthInsurancePlan insurancePlan, int age, boolean smoking) {
double monthlyPremium = 0.0;
if(insurancePlan instanceof PlatinumPlan){
if(age>55){
monthlyPremium = monthlyPremium+ 200;
}
if(smoking){
monthlyPremium = monthlyPremium + 100;
}
return monthlyPremium;
}
else if(insurancePlan instanceof GoldPlan){
if(age>55){
monthlyPremium = monthlyPremium+ 150;
}
if(smoking){
monthlyPremium = monthlyPremium + 90;
}
return monthlyPremium;
}
else if(insurancePlan instanceof SilverPlan){
if(age>55){
monthlyPremium = monthlyPremium+ 100;
}
if(smoking){
monthlyPremium = monthlyPremium + 80;
}
return monthlyPremium;
}
else if (insurancePlan instanceof BronzePlan){
if(age>55){
monthlyPremium = monthlyPremium+ 50;
}
if(smoking){
monthlyPremium = monthlyPremium + 70;
}
return monthlyPremium;
}
return 0;
}
}