Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function catWalking(input) {
- let minutesPerWalk = Number(input[0]);
- let walksNumber = Number(input[1]);
- let caloriesIntake = Number(input[2]);
- let totalMinutes = minutesPerWalk * walksNumber;
- let caloriesBurned = totalMinutes * 5;
- let halfIntake = caloriesIntake / 2;
- if (caloriesBurned >= halfIntake) {
- console.log(`Yes, the walk for your cat is enough. Burned calories per day: ${caloriesBurned}.`);
- } else {
- console.log(`No, the walk for your cat is not enough. Burned calories per day: ${caloriesBurned}.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment