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;
- using System.Numerics;
- namespace Question1
- {
- class Question1
- {
- static void Main()
- {
- int weight = int.Parse(Console.ReadLine());
- int height = int.Parse(Console.ReadLine());
- int age = int.Parse(Console.ReadLine());
- string gender = Console.ReadLine();
- int workouts = int.Parse(Console.ReadLine());
- double newWeight = weight / 2.2;
- double newHeight = height * 2.54;
- double maleBMR = (66.5 + (13.75 * newWeight) + (5.003 * newHeight) - (6.755 * age));
- double femaleBMR = (655 + (9.563 * newWeight) + (1.850 * newHeight) - (4.676 * age));
- double DCI = 0;
- if (gender == "m")
- {
- if (workouts == 0)
- {
- DCI = (maleBMR * 1.2);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 0 && workouts < 4)
- {
- DCI = (maleBMR * 1.375);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 3 && workouts < 7)
- {
- DCI = (maleBMR * 1.55);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 6 && workouts < 10)
- {
- DCI = (maleBMR * 1.725);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 9)
- {
- DCI = (maleBMR * 1.9);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts < 0 )
- {
- DCI = (maleBMR * 1.2);
- Console.WriteLine(Math.Floor(DCI));
- }
- }
- if (gender == "f")
- {
- if (workouts == 0)
- {
- DCI = (femaleBMR * 1.2);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 0 && workouts < 4)
- {
- DCI = (femaleBMR * 1.375);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 3 && workouts < 7)
- {
- DCI = (femaleBMR * 1.55);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 6 && workouts < 10)
- {
- DCI = (femaleBMR * 1.725);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts > 9)
- {
- DCI = (femaleBMR * 1.9);
- Console.WriteLine(Math.Floor(DCI));
- }
- if (workouts < 0 && femaleBMR < 0)
- {
- DCI = ((femaleBMR * 1.2) );
- Console.WriteLine(Math.Floor(DCI));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement