Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CalorieCalculator
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- char gender = char.Parse(Console.ReadLine());
- double weight = double.Parse(Console.ReadLine());
- double height = double.Parse(Console.ReadLine());
- int age = int.Parse(Console.ReadLine());
- string physicalActivity = Console.ReadLine();
- double basalMetabolicRate;
- double coefficientActivity;
- if (gender == 'm')
- {
- basalMetabolicRate = 66 + weight * 13.7 + height * 500 - 6.8 * age;
- }
- else
- {
- basalMetabolicRate = 655 + weight * 9.6 + height * 180 - 4.7 * age;
- }
- if (physicalActivity == "sedentary")
- {
- coefficientActivity = 1.2;
- }
- else if (physicalActivity == "lightly active")
- {
- coefficientActivity = 1.375;
- }
- else if (physicalActivity == "moderately active")
- {
- coefficientActivity = 1.55;
- }
- else
- {
- coefficientActivity = 1.725;
- }
- double calories = basalMetabolicRate * coefficientActivity;
- Console.WriteLine($"To maintain your current weight you will need {Math.Ceiling(calories)} calories per day.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement