Tea Bill Function
JavaScript
10 pts
Tea Bill Function
A cup of tea costs 15 Nakfa. Write a function teaBill(cups) that returns the price for that many cups (it should not print anything itself).
Then use the function inside two template literals to print exactly:
Selam pays 45 Nakfa Abel pays 30 Nakfa
Selam drinks 3 cups and Abel drinks 2 cups, so call teaBill(3) and teaBill(2) — do not type 45 or 30 yourself.
Checklist
- Create a function
teaBill(cups)that returns the price (15 Nakfa per cup). - Use the function in both messages (no typed totals).
- Print the two lines exactly.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
