Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function solve(year, holidays, weekends) {
  2. let weekendsInSofia = 48 - weekends;
  3. let saturdaySofiaGames = (weekendsInSofia * 3.0) / 4;
  4. let gamesInBornTown = weekends;
  5. let gamesInHolidays = (holidays * 2.0) / 3;
  6. let totalGamesWeekends =
  7. saturdaySofiaGames + gamesInBornTown + gamesInHolidays;
  8. if (year == "normal") {
  9. console.log(Math.floor(totalGamesWeekends));
  10. } else if (year == "leap") {
  11. totalGamesWeekends *= 1.15;
  12. console.log(Math.floor(totalGamesWeekends));
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement