CS计算机代考程序代写 package programmingexample6;

package programmingexample6;

public class DiscountDecorator extends Decorator {

private double discount;

public DiscountDecorator(Product product, double discount) {
super(product);
this.discount = discount;
}

@Override
public double getPrice() {
return super.getPrice() * (1 – discount/100);
}

}