Café Discount
JavaScript
20 pts
Café Discount
Abel’s café in Asmara has special offers. Use the given values and create:
getsDiscount— true iftotalis at least 150 or the customer is a memberfreeCake— true if the customer is a member anddayis"Fri"pay—total - 20if there is a discount, otherwisetotal(use the ternary operator)
Print exactly:
Discount: true Free cake: true Pay: 160 Nakfa
Checklist
- Create
getsDiscountwith||. - Create
freeCakewith&&and===. - Calculate
paywith the ternary operator. - Print the three lines.
🔑 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.
