Advertisement
galink

Untitled

Jul 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function TomCat ([arg]) {
  2.     holiDays = parseInt(arg);
  3.  
  4.     let holiMins = 127*holiDays;
  5.     let workDays = 365 - holiDays;
  6.     let WorkMins = workDays*63;
  7.     let PlayMinsTotal = holiMins + WorkMins;
  8.      let rest1 = Math.abs(30000 - PlayMinsTotal);
  9.      
  10.  
  11.  
  12.  
  13.     if (PlayMinsTotal < 30000) {
  14.        
  15.  
  16.         console.log('Tom sleeps well');
  17.         console.log(`${Math.trunc(rest1/60)} hours and ${rest1 % 60} minutes less for play`);
  18.     }
  19.     else {
  20.        
  21.         console.log('Tom will run away');
  22.         console.log(`${Math.trunc(rest1/60)} hours and ${rest1 % 60} minutes more for play`);
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement