Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exam(input) {
- let budjet = Number(input[0])
- let statisti = Number(input[1])
- let cenaZaObleklo = Number(input[2])
- let dekor = budjet * 0.10
- let sumObleklo = statisti * cenaZaObleklo
- let sumAll = dekor + sumObleklo
- let sumLeft = 0;
- let discout = 0;
- if (statisti >= 150) {
- discout = sumObleklo * 0.10
- }
- if (budjet >= sumAll) {
- sumAll = sumAll - discout
- sumLeft = budjet - sumAll
- console.log(`Action!\nWingard starts filming with ${sumLeft.toFixed(2)} leva left.`)
- } else {
- sumAll = sumAll - discout
- sumLeft = Math.abs(budjet - sumAll)
- console.log(`Not enough money!\nWingard needs ${sumLeft.toFixed(2)} leva more.`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement