Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01.DailyCalorieIntake
- {
- class DailyCalorieIntake
- {
- static void Main(string[] args)
- {
- int weight = int.Parse(Console.ReadLine());
- int height = int.Parse(Console.ReadLine());
- int age = int.Parse(Console.ReadLine());
- char gender = char.Parse(Console.ReadLine());
- int workouts = int.Parse(Console.ReadLine());
- double weightKG = (double)weight / 2.2;
- double heightCM = (double)height * 2.54;
- double BMR = 0.0;
- double constant = 0.0;
- if (gender == 'm')
- {
- BMR = 66.5 + (13.75 * weightKG) + (5.003 * heightCM) - (6.755 * age);
- }
- else
- {
- BMR = 655 + (9.563 * weightKG) + (1.85 * heightCM) - (4.676 * age);
- }
- if (workouts <= 0)
- {
- constant = 1.2;
- }
- else if (workouts >= 1 && workouts <= 3)
- {
- constant = 1.375;
- }
- else if (workouts >= 4 && workouts <= 6)
- {
- constant = 1.55;
- }
- else if (workouts >= 7 && workouts <= 9)
- {
- constant = 1.725;
- }
- else
- {
- constant = 1.9;
- }
- Console.WriteLine(Math.Floor(BMR * constant));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement