Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function godzillaVsKong(input) {
- let budget = Number(input[0]);
- let walkons = Number(input[1]);
- let clothing = Number(input[2]);
- let decor = budget * 10 / 100;
- let totalClothingPrice = 0;
- if (walkons <= 150) {
- totalClothingPrice = clothing * walkons;
- } else {
- totalClothingPrice = (clothing * walkons) - ((clothing * walkons)* 10 / 100);
- }
- let totalPrice = decor + totalClothingPrice;
- if (totalPrice > budget) {
- console.log(`Not enough money!`);
- console.log(`Wingard needs ${(totalPrice - budget).toFixed(2)} leva more.`);
- } else {
- console.log(`Action!`);
- console.log(`Wingard starts filming with ${(budget - totalPrice).toFixed(2)} leva left.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment