Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class dailyCalorie
- {
- static void Main()
- {
- int lbs = int.Parse(Console.ReadLine());
- int heightInInches = int.Parse(Console.ReadLine());
- int age = int.Parse(Console.ReadLine());
- char gender = char.Parse(Console.ReadLine());
- int workoutsPerWeek = int.Parse(Console.ReadLine());
- double cm = heightInInches * 2.54;
- double kg = lbs / 2.2;
- double menBmr = 66.5 + (13.75 * kg) + (5.003 * cm) - (6.755 * age);
- double womenBmr = 655 + (9.563 * kg) + (1.850 * cm) - (4.676 * age);
- if (gender == 'm')
- {
- if (workoutsPerWeek <= 0)
- {
- Console.WriteLine(Math.Floor(menBmr * 1.2));
- }
- else if (workoutsPerWeek >= 1 && workoutsPerWeek <= 3)
- {
- Console.WriteLine(Math.Floor(menBmr * 1.375));
- }
- else if (workoutsPerWeek >= 4 && workoutsPerWeek <= 6)
- {
- Console.WriteLine(Math.Floor(menBmr * 1.55));
- }
- else if (workoutsPerWeek >= 7 && workoutsPerWeek <= 9)
- {
- Console.WriteLine(Math.Floor(menBmr * 1.725));
- }
- else
- {
- Console.WriteLine(Math.Floor(menBmr * 1.9));
- }
- }
- else
- {
- if (workoutsPerWeek <= 0)
- {
- Console.WriteLine(Math.Floor(womenBmr * 1.2));
- }
- else if (workoutsPerWeek >= 1 && workoutsPerWeek <= 3)
- {
- Console.WriteLine(Math.Floor(womenBmr * 1.375));
- }
- else if (workoutsPerWeek >= 4 && workoutsPerWeek <= 6)
- {
- Console.WriteLine(Math.Floor(womenBmr * 1.55d));
- }
- else if (workoutsPerWeek >= 7 && workoutsPerWeek <= 9)
- {
- Console.WriteLine(Math.Floor(womenBmr * 1.725));
- }
- else
- {
- Console.WriteLine(Math.Floor(womenBmr * 1.9));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement