Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function godzila(input){
- let movieCost = Number(input[0]);
- let statistNumber = Number(input[1]);
- let oneStastistClothes = Number(input[2]);
- let decorMovieCost = movieCost *0.1;
- let allStatistClothes = statistNumber * oneStastistClothes
- if (statistNumber > 150){
- allStatistClothes = allStatistClothes - (allStatistClothes * 0.1);
- }
- let finalMovieCost = decorMovieCost + allStatistClothes
- if (movieCost > finalMovieCost){
- let sumRest = (movieCost - finalMovieCost).toFixed(2);
- console.log("Action!")
- console.log(`Wingard starts filming with ${sumRest} leva left.`)
- }
- else if (finalMovieCost >= movieCost){
- let sumNeeded = (finalMovieCost - movieCost).toFixed(2)
- console.log("Not enough money!")
- console.log(`Wingard needs ${sumNeeded} leva more.`)
- }
- }
- godzila(["9587.88","222","55.68"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement