Advertisement
Spocoman

Cat Walking

Jan 5th, 2022 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function catWalking(input) {
  2.     let walkMinutes = Number(input[0]),
  3.         walksQuantity = Number(input[1]),
  4.         caloriesConsumed = Number(input[2]),
  5.         burnedCaloriesPerDay = walkMinutes * walksQuantity * 5;
  6.  
  7.     if (burnedCaloriesPerDay >= caloriesConsumed / 2) {
  8.         console.log(`Yes, the walk for your cat is enough. Burned calories per day: ${burnedCaloriesPerDay}.`);
  9.     } else {
  10.         console.log(`No, the walk for your cat is not enough. Burned calories per day: ${burnedCaloriesPerDay}.`);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement