Skip to content

Commit cc32823

Browse files
committed
feat(tiered_pricing): 🟢 make test pass
1 parent 46145ed commit cc32823

File tree

1 file changed

+6
-0
lines changed
  • exercises/tiered_pricing/solutions/oflorez/src/main/java/tv/codely/checkout

1 file changed

+6
-0
lines changed

exercises/tiered_pricing/solutions/oflorez/src/main/java/tv/codely/checkout/TieredPricing.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)