Advertisement
Liliana797979

moeto viarno reshenie lunch break

Feb 10th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function lunchBreak(input) {
  2.     let serialName = input[0];
  3.     let episodeTime = Number(input[1]);
  4.     let restDuration = Number(input[2]);
  5.  
  6.     let lunchTime = restDuration / 8;
  7.     let timeToRelax = restDuration / 4;
  8.     let time = restDuration - lunchTime - timeToRelax;
  9.    
  10.     if (episodeTime <= time) {
  11.         console.log(`You have enough time to watch ${serialName} and left with ${Math.ceil(time - episodeTime)} minutes free time.`);
  12.     } else {
  13.         console.log(`You don't have enough time to watch ${serialName}, you need ${Math.ceil(episodeTime - time)} more minutes.`);
  14.    }
  15. }
  16.  
  17. lunchBreak(["Teen Wolf", "48", "60"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement