private static void Main() { var age = InputAge(); var weight = InputWeight(); var height = InputHeight(); var human = InputGender(age, weight, height); human = FatPercantageDistributor.DistributionByFat(human); human = PhysActivityDistributor.DistributionByPhysActivity(human); var flag = true; while (flag) { Console.WriteLine("1) BMI "); Console.WriteLine("2) Fat Percentage"); Console.WriteLine("3) Daily intake of calories"); Console.WriteLine("4) Exit"); var choice = Console.ReadLine(); var num = int.Parse(choice); switch (num) { case 1: { var bmi = BmiCalculator.GetBmi(human); Console.WriteLine($"Your BMI - {bmi}"); BmiCalculator.AnalyseBmi(human); break; } case 2: { FatPercentageCalculator.GetFatPercentage(human); FatPercentageCalculator.AnalyseFatPercentage(human); break; } case 3: { Console.WriteLine($"Your normal intake of calories - {human.GetDailyKCal()}"); break; } case 4: { flag = false; break; } } } }
protected static float CalculateFatPercentage(Human human) { var bmi = BmiCalculator.GetBmi(human); if (human is Male) { return((1.2f * bmi) + (0.23f * human.Age) - 16.2f); } else { return((1.2f * bmi) + (0.23f * human.Age) - 5.4f); } }