We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 920d49d commit edede15Copy full SHA for edede15
exercises/tiered_pricing/solutions/isaac1024_baby-steps/src/tiered_pricing.rs
@@ -3,10 +3,11 @@ fn get_total_subscription_price(number_of_subscriptions: u32) -> u32 {
3
const SECOND_UNIT_PRICE: u32 = 239;
4
const THIRD_UNIT_PRICE: u32 = 219;
5
const FOURTH_UNIT_PRICE: u32 = 199;
6
+ const FIFTH_UNIT_PRICE: u32 = 149;
7
8
match number_of_subscriptions {
- 51 => 149 * number_of_subscriptions,
9
- 52 => 149 * number_of_subscriptions,
+ 51 => FIFTH_UNIT_PRICE * number_of_subscriptions,
10
+ 52 => FIFTH_UNIT_PRICE * number_of_subscriptions,
11
1|2 => FIRST_UNIT_PRICE * number_of_subscriptions,
12
3..=10 => SECOND_UNIT_PRICE * number_of_subscriptions,
13
11..=25 => THIRD_UNIT_PRICE * number_of_subscriptions,
0 commit comments