Advertisement
Spocoman

Cat Walking

Sep 2nd, 2024 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int walkMinutes = Integer.parseInt(scanner.nextLine()),
  7.             walksQuantity = Integer.parseInt(scanner.nextLine()),
  8.             caloriesConsumed = Integer.parseInt(scanner.nextLine()),
  9.             burnedCaloriesPerDay = walkMinutes * walksQuantity * 5;
  10.  
  11.         if (burnedCaloriesPerDay >= caloriesConsumed / 2) {
  12.             System.out.printf("Yes, the walk for your cat is enough. Burned calories per day: %d.\n", burnedCaloriesPerDay);
  13.         } else {
  14.             System.out.printf("No, the walk for your cat is not enough. Burned calories per day: %d.\n", burnedCaloriesPerDay);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement