Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CatWalking_02 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int minutesPerWalk = Integer.parseInt(scanner.nextLine());
- int countWalks = Integer.parseInt(scanner.nextLine());
- int calories = Integer.parseInt(scanner.nextLine());
- int totalMinutes = countWalks * minutesPerWalk;
- int totalBurnedCalories = totalMinutes * 5;
- double halfCalories = 0.5 * calories;
- if(totalBurnedCalories >= halfCalories){
- System.out.printf("Yes, the walk for your cat is enough. Burned calories per day: %d.", totalBurnedCalories);
- } else {
- System.out.printf("No, the walk for your cat is not enough. Burned calories per day: %d.", totalBurnedCalories);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement