The Café Bill
JavaScript
10 pts
The Café Bill
The array prices holds the prices of four items. Use a for…of loop to print every price and add it to total. After the loop, print the total. Expected output:
Item: 15 Nakfa Item: 25 Nakfa Item: 10 Nakfa Item: 30 Nakfa Total: 80 Nakfa
Checklist
- Loop over
priceswithfor…of. - Add every price to
total(do not type the answer). - Print each item line and the total line.
🔑 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.
