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).
- Construct a message taking these values.
- Return the text exactly as: "The [item] costs [price] rupees."
01EXAMPLE 1
Input
item = "Phone", price = 50000Output
"The Phone costs 50000 rupees."Constraints
- Use the parameters item and price.
- Punctuation and spaces must match exactly.
FundamentalsStringsTemplate Literals
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
item"Phone"
price50000
Expected Output
The Phone costs 50000 rupees.
Click RUN to test your solution