Advertisement
Liliana797979

flowers

Dec 8th, 2020
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function flowers(arg1, arg2, arg3, arg4, arg5) {
  2.     let magnoliasCount = Number(arg1);
  3.     let hyathinthusCount = Number(arg2);
  4.     let rosesCount = Number(arg3);
  5.     let cactiCount = Number(arg4);
  6.     let price = Number(arg5);
  7.  
  8.     let magnoliasPrice = magnoliasCount * 3.25;
  9.     let hyathinthusPrice = hyathinthusCount * 4;
  10.     let rosesPrice = rosesCount * 3.5;
  11.     let cactiPrice = cactiCount * 8;
  12.     let totalPrice = magnoliasPrice + hyathinthusPrice + rosesPrice + cactiPrice;
  13.     let taxes = totalPrice * 5/100;
  14.     let profit = totalPrice - taxes;
  15.     let money = "";
  16.     let totalProfit = money - profit;
  17.  
  18.     if (money === "arrived") {
  19.         console.log(`She is left with ${(Math.floor)(money - profit)} leva.`);
  20.        
  21.     } else {
  22.         console.log(`She will have to borrow ${(Math.ceil)(profit - money)} leva.`);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement