Skip to content

Instantly share code, notes, and snippets.

@SauelAlmonte
Created January 13, 2023 18:35
Show Gist options
  • Save SauelAlmonte/916f328a2f57adce48318dd22154fa21 to your computer and use it in GitHub Desktop.
Save SauelAlmonte/916f328a2f57adce48318dd22154fa21 to your computer and use it in GitHub Desktop.
Restaurant bill + tip = x
// 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