Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleeppyTom(arg1) {
- let totalPlayMinutes = Number(arg1);
- let workingDays = 365 - holidays;
- let totalPlayMinutes = workingDays * 63 + holidays * 127;
- let difference = Math.abs(totalPlayMinutes - 30000);
- let hours = difference / 60;
- let minutes = difference % 60;
- if (totalPlayMinutes > 30000) {
- console.log(`Tom will run away`);
- console.log(`${Math.floor(hours)} hours and ${Math.floor(minutes)} minutes more for play`);
- }
- } else {
- console.log(`Tom sleeps well`);
- console.log(`${Math.floor(hours)} hours and ${Math.floor(minutes)} minutes less for play`);
- }
- sleeppyTom("20");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement