Advertisement
ivanov_ivan

DailyBuraBura

Feb 8th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DailyCalorieIntake
  8. {
  9.     class DailyCalorieIntake
  10.     {
  11.         static void Main()
  12.         {
  13.             double W = double.Parse(Console.ReadLine()) / 2.2D;
  14.             double H = double.Parse(Console.ReadLine()) * 2.54D;
  15.             double A = double.Parse(Console.ReadLine());
  16.             char gender = char.Parse(Console.ReadLine());
  17.             double E = double.Parse(Console.ReadLine());
  18.  
  19.             double BMR = 0;
  20.  
  21.             if(gender == 'm')
  22.             {
  23.                 BMR = 66.5D + ( 13.75D * W ) + ( 5.003D * H ) - ( 6.755D * A );
  24.             }
  25.             else
  26.             {
  27.                 BMR = 655.0 + ( 9.563D * W ) + ( 1.850D * H ) - ( 4.676 * A );
  28.             }
  29.  
  30.             double DCI = 0;
  31.  
  32.             if(E < 1)
  33.             {
  34.                 DCI = BMR * 1.2D;
  35.             }
  36.             else if(E > 0 && E < 4)
  37.             {
  38.                 DCI = BMR * 1.375D;
  39.             }
  40.             else if(E > 3 && E < 7)
  41.             {
  42.                 DCI = BMR * 1.55D;
  43.             }
  44.             else if(E > 6 && E < 10)
  45.             {
  46.                 DCI = BMR * 1.725D;
  47.             }
  48.             else
  49.             {
  50.                 DCI = BMR * 1.9D;
  51.             }
  52.            
  53.  
  54.             Console.WriteLine(Math.Floor(DCI));
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement