Ejemplo n.º 1
0
        public static void Main()
        {
            Console.Write("Please enter your first name: ");
            string firstName = Console.ReadLine();

            Console.Write("Please enter your last name: ");
            string lastName = Console.ReadLine();

            Console.Write("Please enter your gender: ");
            string gender = Console.ReadLine();

            Console.Write("Please enter your month of birth: ");
            int monOfBirth = Convert.ToInt32(Console.ReadLine());

            Console.Write("Please enter your day of birth: ");
            int dayOfBirth = Convert.ToInt32(Console.ReadLine());

            Console.Write("Please enter your year of birth: ");
            int yearOfBirth = Convert.ToInt32(Console.ReadLine());

            Console.Write("Please enter your height in meters: ");
            double height = Convert.ToDouble(Console.ReadLine());

            Console.Write("Please enter your weight in kg: ");
            double weight = Convert.ToDouble(Console.ReadLine());

            HealthProfile me = new HealthProfile(firstName, lastName, gender, monOfBirth, dayOfBirth, yearOfBirth, height, weight);

            Console.WriteLine("My age is {0}", me.GetAge());
            Console.WriteLine("My BMI is {0}", me.GetBMI(me.Weight, me.Height));
            Console.WriteLine("My max heart rate is {0}", me.GetMaxHeartRate);
            Console.WriteLine("My target heart range is {0}-{1}", me.GetMinTargetHeartRate, me.GetMaxTargetHeartRate);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            HealthProfile myProfile = new HealthProfile();

            Console.WriteLine("Name: {0}, {1}" +
                              "\nGender: {2}" +
                              "\nBMI: {3}" +
                              "\nMax HR: {4}",
                              myProfile.LastName, myProfile.FirtName, myProfile.Gender, myProfile.GetBMI(), myProfile.MaximumHeartRate());
        }