Advertisement
AlexandrP

Football

Dec 18th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function x (input){
  2.  
  3. let tsenaNaTeniska = Number(input [0]);
  4. let SumaKoqtoTrqbvaZaTopka = input [1]
  5.  
  6. let shorti = tsenaNaTeniska * 0.75
  7. let chorapi = shorti * 0.2
  8. let butonkite = 2 * (tsenaNaTeniska + shorti)
  9.  
  10. let sum = tsenaNaTeniska + shorti + chorapi +  butonkite
  11. let sumwithItstipka = sum * 0.85
  12.  
  13. if (sumwithItstipka >= SumaKoqtoTrqbvaZaTopka){
  14.     console.log("Yes, he will earn the world-cup replica ball!");
  15.     console.log(`His sum is ${sumwithItstipka.toFixed(2)} lv.`);
  16. }else{
  17.     console.log("No, he will not earn the world-cup replica ball.");
  18.     let diff = SumaKoqtoTrqbvaZaTopka - sumwithItstipka
  19.     console.log(`He needs ${diff.toFixed(2)} lv. more.`);
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.    
  30. }
  31. x (["25", "100"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement