Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function flowers(arg1, arg2, arg3, arg4, arg5) {
- let magnoliasCount = Number(arg1);
- let hyathinthusCount = Number(arg2);
- let rosesCount = Number(arg3);
- let cactiCount = Number(arg4);
- let price = Number(arg5);
- let magnoliasPrice = magnoliasCount * 3.25;
- let hyathinthusPrice = hyathinthusCount * 4;
- let rosesPrice = rosesCount * 3.5;
- let cactiPrice = cactiCount * 8;
- let totalPrice = magnoliasPrice + hyathinthusPrice + rosesPrice + cactiPrice;
- let taxes = totalPrice * 5/100;
- let profit = totalPrice - taxes;
- let money = "";
- let totalProfit = money - profit;
- if (money === "arrived") {
- console.log(`She is left with ${(Math.floor)(money - profit)} leva.`);
- } else {
- console.log(`She will have to borrow ${(Math.ceil)(profit - money)} leva.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement