Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tom([arg1]) {
- let holiday = parseInt(arg1);
- let workingday = 365 - holiday;
- let totalPlay = (workingday * 63) + (holiday *127);
- let freetime = Math.abs(totalPlay - 30000);
- let hours = (freetime / 60);
- let minutes = (freetime % 60);
- if (totalPlay > 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 sleep well") ;
- console.log('${Math.floor(hours)} hours and
- ${Math.floor(minutes)} minutes less play );
- }
- }
- tom([20])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement