Skip to content

Instantly share code, notes, and snippets.

@Naomi-Dennis
Last active January 2, 2020 13:12
Show Gist options
  • Save Naomi-Dennis/1e90f990d9c41a894b64f729aabaee49 to your computer and use it in GitHub Desktop.
Save Naomi-Dennis/1e90f990d9c41a894b64f729aabaee49 to your computer and use it in GitHub Desktop.
myLoyaltyPoints = 50
itemPrice = new ShopItem(100)
total = calculateTotal(itemPrice, myLoyaltyPoints)
function calculateTotal(price, loyaltyPoints) {
return calculateDiscount(price, loyaltyPoints) + calculateTip(price) + calculateSalesTax(price)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment