We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Calculate Balance

We need to calculate the total cost for a batch of messages, and update the user's balance if they have enough money.

Assignment

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.