Created
September 26, 2017 23:47
-
-
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.
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
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