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