Advertisement
chrispicy

Pizza Order.js

Aug 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let orderCount = 0;
  2.  
  3. const takeOrder = (topping, crustType) => {
  4.   orderCount++;
  5.   console.log('Order: ' + crustType + ' pizza topped with ' + topping);
  6. };
  7.  
  8. takeOrder('Double Pepperoni', 'Hand-tossed');
  9. takeOrder('Double Pepperoni', 'Hand-tossed');
  10.  
  11. const getSubTotal = (itemCount) => {
  12.   return itemCount * 8.75;
  13. };
  14.  
  15. const getTax = (itemCount) => {
  16.   return getSubTotal(itemCount) * 0.095
  17. }
  18.  
  19. const getTotal = (itemCount) => {
  20.   return getSubTotal(itemCount) + getTax(itemCount)
  21. }
  22.  
  23. console.log(getTotal(orderCount));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement