Advertisement
Liliana797979

voleiboll viarno reshenie

Jan 30th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function voleyball(input) {
  2.  
  3.     let year = input[0];
  4.     let holydays = Number(input[1]);
  5.     let travelWeekends = Number(input[2]);
  6.  
  7.     let weekendsInSofia = 48 - travelWeekends;
  8.  
  9.     let playsInSofia = weekendsInSofia * 0.75;
  10.     let playsInHolydays = holydays * 2.0 / 3;
  11.  
  12.     let totalPlays = playsInSofia + playsInHolydays + travelWeekends;
  13.  
  14.     if (year === "leap") {
  15.         totalPlays *= 1.15;
  16.     }
  17.  
  18.     console.log(Math.floor(totalPlays));
  19. }
  20. voleyball(["normal","6","13"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement