Advertisement
Liliana797979

godzila

Dec 2nd, 2020
411
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.     let money = 0;
  6.    
  7.     if (extraCount > 150) {
  8.         discount = 0.10 * clothPrice;
  9.     }
  10.  
  11.     let decorSum = 0.10 * budget;
  12.     clothPrice = clothPriceForExtra * extraCount;
  13.     budget = clothPrice + decorSum;
  14.  
  15.     if (money > budget) {
  16.  
  17.         console.log(`Not enough money!`);
  18.         console.log(`Wingard needs ${(toFixed(2))(money - budget)} leva more.`);
  19.     } else if (money <= budget) {
  20.  
  21.         console.log(`Action!`);
  22.         console.log(`Wingard starts filming with ${(toFixed(2))(budget - money)} leva left.`);
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement