☑Kizspy.me
public double calculate Price (double basePrice, int quantity, String customerType)
double vipDiscount = 0.20; // 20% VIP discount
return basePrice quantity (1 vipDiscount);
}
public class FlowerOrder (
private Pricing pricing;
public void setPricing (Pricing p) {
this.pricingStrategy = p;
}
public double calculateOrderTotal (double basePrice, int quantity, String
customerType) {
return pricing.calculatePrice (basePrice, quantity, customerType);
Zoom
1. WHAT DESIGN PATTERN is used in the code above? Identify its name and pattern family
(creational, structural, or behavioral.) (0.5 points)
+ 100%
Close