Advertisement
Liliana797979

vqrno reshenie na godzila kong

Dec 5th, 2020
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function godzila(arg1, arg2, arg3) {
  2.     let budget = Number(arg1);
  3.     let extraCount = Number(arg2);
  4.     let clothPriceForExtra = Number(arg3);
  5.  
  6.     let decorSum = 0.1 * budget;
  7.     let clothPrice = clothPriceForExtra * extraCount;
  8.     if (extraCount > 150) {
  9.         clothPrice *= 0.9;
  10.     }
  11.     let money = clothPrice + decorSum;
  12.  
  13.     if (money > budget) {
  14.         console.log(`Not enough money!`);
  15.         console.log(`Wingard needs ${(money - budget).toFixed(2)} leva more.`);
  16.     } else if (money <= budget) {
  17.         console.log(`Action!`);
  18.         console.log(
  19.             `Wingard starts filming with ${(budget - money).toFixed(
  20.                 2
  21.             )} leva left.`
  22.         );
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement