

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
Not enough gems
Cost: 6 gems
1: Conditionals
incomplete
2: The Initial Statement of an If Block
incomplete
3: Switch
incomplete
4: Calculate Balance
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
We need to calculate the total cost for a batch of messages, and update the user's balance if they have enough money.
Using the given variables, write conditional statements to calculate and update the variables.
For example, a discountRate of 0.10 means the discounted price per message would be 90% of the original price.