Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function solve(input) {
  2. let budget = Number(input.shift());
  3. let statist = Number(input.shift());
  4. let clothesPriceForStatist = Number(input.shift());
  5.  
  6. let clothesPrice = clothesPriceForStatist * statist;
  7. let decor = budget * 0.10;
  8. let filmCost = decor + clothesPrice;
  9.  
  10. if (statist >= 150) {
  11. clothesPrice = clothesPrice - clothesPrice * 0.1
  12. }
  13. if (filmCost > budget) {
  14. console.log(`Not enough money !`)
  15. console.log(`Wingard needs ${filmCost - budget} leva more.`)
  16. }
  17. if (filmCost <= budget) {
  18. console.log(`Action !`)
  19. console.log(`Wingard starts filming with ${budget - filmCost} leva left.`)
  20. }
  21. // console.log(decor)
  22. // console.log(clothesPrice)
  23. // console.log(filmCost)
  24. }
  25. solve(["15437.62", "186", "57.99"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement