Exemple #1
0
        static void Main(string[] args)
        {
            var client = new BmiCalculatorServiceClient();

            Console.WriteLine("Mata in din vikt i kilogram:");
            var weight = double.Parse(Console.ReadLine());

            Console.WriteLine("Mata in din längd i centimeter:");
            var lenght = double.Parse(Console.ReadLine());
            var bmi = client.CalculateBmi(weight, lenght);

            Console.WriteLine("Ditt BMI baserat på vikt {0}kg och längden {1}cm, är: {2}", weight, lenght, bmi);
            Console.ReadKey();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var client = new BmiCalculatorServiceClient();

            
            var weight = double.Parse(textBox_kg.Text);

            var lenght = double.Parse(textBox_cm.Text);
            var bmi = client.CalculateBmi(weight, lenght);

            label_result.Text = bmi.ToString();
            

        }