static void Main(string[] args) { CalculateBMIClient client = new CalculateBMIClient(); var result = client.CalculateBmi(75, 1.75); Console.WriteLine(result); Console.ReadKey(); }
private void btnCalculate_Click(object sender, EventArgs e) { CalculateBMIClient client = new CalculateBMIClient(); var length = double.Parse(textBox1.Text); var weight = double.Parse(textBox2.Text); var result = client.CalculateBmi(length, weight).ToString(); lblResult.Text = result; }
static void Main(string[] args) { CalculateBMIClient client = new CalculateBMIClient(); Console.WriteLine("Type length: "); var length = double.Parse(Console.ReadLine()); Console.WriteLine("Type weight: "); var weight = double.Parse(Console.ReadLine()); var result = client.CalculateBmi(length,weight); Console.WriteLine($"Your BMI is: {result}"); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Enter weight"); double weight = double.Parse(Console.ReadLine()); Console.WriteLine("Enter your length"); double length = double.Parse(Console.ReadLine()); CalculateBMIClient client = new CalculateBMIClient(); double result = client.CalcBMI(weight, length); Console.WriteLine("the result is: " + result); Console.ReadLine(); }
private void button1_Click(object sender, EventArgs e) { lblResult.Text = ""; CalculateBMIClient client = new CalculateBMIClient(); string height = txtHeight.Text; string weight = txtWeight.Text; double convertedHeight = double.Parse(height); double convertedWeight = double.Parse(weight); var result = client.CalcBMI(convertedWeight, convertedHeight); lblResult.Text = result.ToString(); }
private void GetResult_Click(object sender, EventArgs e) { CalculateBMIClient client = new CalculateBMIClient(); lbl_result.Text = client.CalculateBmi(double.Parse(tbx_weight.Text), double.Parse(textBox2.Text)).ToString(); }