Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TomCat ([arg]) {
- holiDays = parseInt(arg);
- let holiMins = 127*holiDays;
- let workDays = 365 - holiDays;
- let WorkMins = workDays*63;
- let PlayMinsTotal = holiMins + WorkMins;
- let rest1 = Math.abs(30000 - PlayMinsTotal);
- if (PlayMinsTotal < 30000) {
- console.log('Tom sleeps well');
- console.log(`${Math.trunc(rest1/60)} hours and ${rest1 % 60} minutes less for play`);
- }
- else {
- console.log('Tom will run away');
- console.log(`${Math.trunc(rest1/60)} hours and ${rest1 % 60} minutes more for play`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement