Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(movieBudget, statistCount, singleOutfitPrice){
- movieBudget = Number(movieBudget);
- statistCount = Number(statistCount);
- singleOutfitPrice = Number(singleOutfitPrice);
- let decoratingsPrice, outfitPrice, totalSum;
- decoratingsPrice = movieBudget * 0.1;
- outfitPrice = statistCount * singleOutfitPrice;
- if(statistCount > 150) {
- outfitPrice = outfitPrice * 0.9;
- }
- totalSum = decoratingsPrice + outfitPrice;
- if (movieBudget >= totalSum) {
- console.log(`Action!`);
- console.log(`Wingard starts filming with ${(movieBudget - totalSum).toFixed(2)} leva left.`);
- } else {
- console.log(`Not enough money!`);
- console.log(`Wingard needs ${(totalSum - movieBudget).toFixed(2)} leva more.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement