Café Bill with Variables
JavaScript
20 pts
Café Bill with Variables
Selam orders at the café. Create these variables with let: teaPrice = 15, breadPrice = 10, teaCups = 3, breadPieces = 2, and total = the cost of all tea plus all bread (calculated from the variables). Print Total: 65.
Then Selam orders one more tea: increase teaCups by 1 with teaCups = teaCups + 1;, calculate total again the same way, and print New total: 80.
Total: 65 New total: 80
Do not type 65 or 80 anywhere.
Checklist
- Create the bread variables.
- Add one tea cup to
teaCups. - Calculate
totalfrom the variables, twice. - Print both totals.
🔑 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.
