Created
January 13, 2023 18:35
-
-
Save SauelAlmonte/916f328a2f57adce48318dd22154fa21 to your computer and use it in GitHub Desktop.
Restaurant bill + tip = x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bill Values 275, 40 , 430 | |
const bill = 430; | |
const tip = (bill >= 50 && bill <= 300 ? 15 : 20); | |
console.log(`The bill was $${bill}, the tip was $${bill * tip / 100}, the total bill is $${bill + (bill * tip) / 100}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment