File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
exercises/tiered_pricing/solutions/oflorez/src/main/java/tv/codely/checkout Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,17 @@ public class TieredPricing {
1010 public static final int SECOND_RANGE_LOWER_LIMIT = 3 ;
1111 public static final int SECOND_RANGE_UPPER_LIMIT = 10 ;
1212
13+ public static final int THIRD_RANGE_UNIT_PRICE = 219 ;
14+ public static final int THIRD_RANGE_LOWER_LIMIT = 11 ;
15+ public static final int THIRD_RANGE_UPPER_LIMIT = 25 ;
16+
1317 public int calculateTotalPrice (int amount_subscriptions ) {
1418 if (amount_subscriptions >= FIRST_RANGE_LOWER_LIMIT && amount_subscriptions <= FIRST_RANGE_UPPER_LIMIT ) return amount_subscriptions * FIRST_RANGE_UNIT_PRICE ;
1519
1620 if (amount_subscriptions >= SECOND_RANGE_LOWER_LIMIT && amount_subscriptions <= SECOND_RANGE_UPPER_LIMIT ) return amount_subscriptions * SECOND_RANGE_UNIT_PRICE ;
1721
22+ if (amount_subscriptions >= THIRD_RANGE_LOWER_LIMIT && amount_subscriptions <= THIRD_RANGE_UPPER_LIMIT ) return amount_subscriptions * THIRD_RANGE_UNIT_PRICE ;
23+
1824 return 0 ;
1925 }
2026}
You can’t perform that action at this time.
0 commit comments