Skip to content

Instantly share code, notes, and snippets.

@juliaamosova
Created September 26, 2017 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliaamosova/923ddf1e4fa884a1d742897b876e0c6e to your computer and use it in GitHub Desktop.
Save juliaamosova/923ddf1e4fa884a1d742897b876e0c6e to your computer and use it in GitHub Desktop.
Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost.
var tip = mealCost * tipPercent/100;
var tax = mealCost * taxPercent/100;
var totalCost = Math.round(mealCost + tip + tax);
console.log("The total meal cost is " + totalCost + " dollars.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment