Bill Message

EasyAcc. 96.2%
+15 XP 5

Making Sentences

Generating bills or alerts requires mixing simple text with number values. In JavaScript, we can join different parts to make a complete and readable message.

The Assignment

Your function receives two parameters: item (string) and price (number).

  1. Construct a message taking these values.
  2. Return the text exactly as: "The [item] costs [price] rupees."

01EXAMPLE 1

Inputitem = "Phone", price = 50000
Output"The Phone costs 50000 rupees."

Constraints

  • Use the parameters item and price.
  • Punctuation and spaces must match exactly.
FundamentalsStringsTemplate Literals
JavaScript
Loading...
5 Hidden

Input Arguments

item"Phone"
price50000

Expected Output

The Phone costs 50000 rupees.

Click RUN to test your solution