Advertisement
Liliana797979

sleeppy tom

Dec 5th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sleeppyTom(arg1) {
  2.     let totalPlayMinutes = Number(arg1);
  3.     let workingDays = 365 - holidays;
  4.     let totalPlayMinutes = workingDays * 63 + holidays * 127;
  5.     let difference = Math.abs(totalPlayMinutes - 30000);
  6.     let hours = difference / 60;
  7.     let minutes = difference % 60;
  8.  
  9.     if (totalPlayMinutes > 30000) {
  10.         console.log(`Tom will run away`);
  11.         console.log(`${Math.floor(hours)} hours and ${Math.floor(minutes)} minutes more for play`);
  12.     }
  13.    
  14.     } else {
  15.         console.log(`Tom sleeps well`);
  16.         console.log(`${Math.floor(hours)} hours and ${Math.floor(minutes)} minutes less for play`);
  17.     }
  18.  
  19.  
  20. sleeppyTom("20");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement