Advertisement
emodev

Untitled

Jan 25th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function christmasCandy(input) {
  2.     let baklava = Number(input[0]);
  3.     let muffin = Number(input[1]);
  4.     let bowlAmount = Number(input[2]);
  5.     let candyAmount = Number(input[3]);
  6.     let biscuitsAmount = Number(input[4]);
  7.  
  8.     let bowlPrice = baklava + baklava * 0.6;
  9.     let candyPrice = (muffin + muffin * 0.8);
  10.     let biscuitsPrice = 7.5;
  11.    
  12.     let bowl = bowlPrice * bowlAmount;
  13.     let candy = candyPrice * candyAmount;
  14.     let biscuits = biscuitsPrice * biscuitsAmount;
  15.  
  16.     let totalAmount = ((bowl + candy + biscuits).toFixed(2));
  17.  
  18.     console.log(totalAmount);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement