Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let budget = Number(input.shift());
- let statist = Number(input.shift());
- let clothesPriceForStatist = Number(input.shift());
- let clothesPrice = clothesPriceForStatist * statist;
- let decor = budget * 0.10;
- let filmCost = decor + clothesPrice;
- if (statist >= 150) {
- clothesPrice = clothesPrice - clothesPrice * 0.1
- }
- if (filmCost > budget) {
- console.log(`Not enough money !`)
- console.log(`Wingard needs ${filmCost - budget} leva more.`)
- }
- if (filmCost <= budget) {
- console.log(`Action !`)
- console.log(`Wingard starts filming with ${budget - filmCost} leva left.`)
- }
- // console.log(decor)
- // console.log(clothesPrice)
- // console.log(filmCost)
- }
- solve(["15437.62", "186", "57.99"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement