Quick TotaL

EasyAcc. 93.5%
+25 XP 8

Incrementing Bills

Writing variable = variable + 5 feels too long for simple everyday changes. So developers commonly rely on += to add onto an existing number neatly. It also manages adding strings perfectly too!

The Assignment

You are updating a customer's payment total.

  1. Make a variable total carrying the initialValue.
  2. Add the amountToAdd exactly to total using +=.
  3. Use += once more to attach " INR" string at the end of the total.
  4. Return this formatted string.

01EXAMPLE 1

InputinitialValue = 100, amountToAdd = 50
Output"150 INR"

Explanation: Value added then string correctly appended.

Constraints

  • Use the += operator.
  • Final result must contain the INR text.
FundamentalsVariablesOperators
JavaScript
Loading...
5 Hidden

Input Arguments

initialValue100
amountToAdd50

Expected Output

150 INR

Click RUN to test your solution