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