Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lunchBreak([arg1, arg2, arg3]) {
- name = arg1
- episode = Number(arg2);
- breakTime = Number(arg3);
- lunch = breakTime / 8;
- rest = breakTime / 4;
- time = breakTime - lunch - rest;
- if(time >= episode) {
- console.log(`You have enough time to watch ${name} and left with ${Math.ceil(time - episode)}
- minutes free time.`);
- } else {
- console.log(`You don't have enough time to watch ${name}, you need ${Math.ceil(episode - time)} more
- minutes.`);
- }
- }
- lunchBreak(["Game of Thrones", 60, 96])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement