You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1yl/FixedAmountDiscount.java

23 lines
443 B

package ;
/**
* @author The Administrator
* @version 1.0
* @created 26-10月-2025 20:21:39
*/
public class FixedAmountDiscount implements DiscountStrategy {
private final double fixedAmount = 10.0;
public FixedAmountDiscount(){
}
public void finalize() throws Throwable {
}
public double calculateDiscount(double amount) {
return Math.min(fixedAmount, amount);
}
}//end FixedAmountDiscount