Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function tom([arg1]) {
  2.  
  3. let holiday = parseInt(arg1);
  4. let workingday = 365 - holiday;
  5. let totalPlay = (workingday * 63) + (holiday *127);
  6. let freetime = Math.abs(totalPlay - 30000);
  7. let hours = (freetime / 60);
  8. let minutes = (freetime % 60);
  9.  
  10. if (totalPlay > 30000) { console.log("Tom will run away") ;
  11. console.log('${Math.floor(hours)} hours and ${Math.floor(minutes)} minutes more for play');
  12.  
  13. } else {
  14. console.log("Tom sleep well") ;
  15. console.log('${Math.floor(hours)} hours and
  16. ${Math.floor(minutes)} minutes less play );
  17. }
  18. }
  19. tom([20])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement