Advertisement
ggeorgiev88

Georgi Georgiev

Nov 11th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function godzila(input){
  2.  
  3.  
  4. let movieCost = Number(input[0]);
  5. let statistNumber = Number(input[1]);
  6. let oneStastistClothes = Number(input[2]);
  7.  
  8.  
  9. let decorMovieCost = movieCost *0.1;
  10. let allStatistClothes = statistNumber * oneStastistClothes
  11.  
  12.  
  13. if (statistNumber > 150){
  14.     allStatistClothes = allStatistClothes - (allStatistClothes * 0.1);
  15. }
  16. let finalMovieCost = decorMovieCost + allStatistClothes
  17. if (movieCost > finalMovieCost){
  18.     let sumRest = (movieCost - finalMovieCost).toFixed(2);
  19.     console.log("Action!")
  20.     console.log(`Wingard starts filming with ${sumRest} leva left.`)
  21. }
  22. else if (finalMovieCost >= movieCost){
  23. let sumNeeded = (finalMovieCost - movieCost).toFixed(2)
  24. console.log("Not enough money!")
  25. console.log(`Wingard needs ${sumNeeded} leva more.`)
  26. }
  27. }
  28. godzila(["9587.88","222","55.68"])
Tags: Godzila
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement