Advertisement
Guest User

Untitled

a guest
Jan 25th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  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).toFixed(2));
  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. }
  20. christmasCandy([5.55, 3.57, 4.3, 3.6, 7])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement