Advertisement
desislava_topuzakova

02. Cat Walking

Mar 31st, 2020
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02._Cat_Walking
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int minutesPerWalk = int.Parse(Console.ReadLine());
  10.             int countWalks = int.Parse(Console.ReadLine());
  11.             int calories = int.Parse(Console.ReadLine());
  12.  
  13.             int totalMinutes = countWalks * minutesPerWalk;
  14.             int totalBurnedCalories = totalMinutes * 5;
  15.             double halfCalories = 0.5 * calories;
  16.  
  17.             if (totalBurnedCalories >= halfCalories)
  18.             {
  19.                 Console.WriteLine($"Yes, the walk for your cat is enough. Burned calories per day: {totalBurnedCalories}.");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"No, the walk for your cat is not enough. Burned calories per day: {totalBurnedCalories}.");
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement