Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function godzillaVsKong(input) {
- let budget = Number(input.shift());
- let statist = Number(input.shift());
- let clothing = Number(input.shift());
- let decor = budget * 0.1;
- let sumClothing = statist * clothing;
- if (statist > 150) {
- sumClothing = sumClothing - (sumClothing * 0.1);
- }
- let filmCost = decor + sumClothing;
- if (filmCost <= budget) {
- console.log(`Action!`)
- console.log(`Wingard starts filming with ${(budget - filmCost).toFixed(2)} leva left.`)
- }else {
- console.log(`Not enough money!`)
- console.log(`Wingard needs ${(Math.abs(budget-filmCost)).toFixed(2)} leva more.`)
- }
- }
Add Comment
Please, Sign In to add comment