Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var orderCount = 0;
- function takeOrder(topping, crustType) {
- console.log('Order: ' + crustType + ' crust topped with ' + topping);
- orderCount = orderCount + 1;
- }
- function getSubTotal(itemCount, numberOfItems) {
- return itemCount * 7.5;
- }
- function getTax(){
- return getSubTotal(orderCount) * 0.06
- }
- function getTotal(){
- return getSubTotal(orderCount) + getTax();
- }
- takeOrder('bacon', 'thin');
- takeOrder('pepperoni', 'regular');
- takeOrder('pesto', 'thin');
- console.log(getSubTotal(orderCount));
- console.log(getTotal())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement