Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function marketToys (arg1, arg2, arg3, arg4, arg5, arg6) {
- let excursionPrice = Number(arg1);
- let puzzlesCount = Number(arg2);
- let dollsCount = Number(arg3);
- let teddyBears = Number(arg4);
- let minionsCount = Number(arg5);
- let trucksCount = Number(arg6);
- let toys = 0;
- if (toys >= 50) {
- let discount = 0.25 * totalSum;
- }
- let totalSum = puzzlesCount * 2.60 + teddyBears * 4.10 + minionsCount * 8.20 + trucksCount * 2;
- let toysCount = puzzlesCount + teddyBears + minionsCount + trucksCount;
- let totalPrice = totalSum - (totalSum * discount);
- let rent = 0.10 * totalPrice;
- totalProfit = totalPrice - rent;
- totalMoney = totalProfit - excursionPrice;
- if (money == "enough") {
- console.log(`Yes! ${totalMoney - totalProfit} lv left.`);
- } else {
- console.log(`Not enough money! ${totalProfit - totalMoney} lv needed.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement