private void buttonBMI_Click(object sender, EventArgs e) { var weight = int.Parse(textBoxWeight.Text); var length = double.Parse(textBoxLength.Text); BMIClient bmi = new BMIClient(); labelBMI.Text = bmi.CalculateBMI(weight, length); }
private void buttonBMI_Click(object sender, EventArgs e) { var weight = int.Parse(textBoxWeight.Text); var length = double.Parse(textBoxLength.Text); BMIClient bmi = new BMIClient(); labelBMI.Text = bmi.CalculateBMI(weight, length); }
static void Main(string[] args) { BMIClient host = new BMIClient(); Console.WriteLine("Skriv in din längd: "); var height = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine("Skriv in din vikt: "); var weight = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine(host.BMI(height, weight)); Thread.Sleep(5000); }
static void Main(string[] args) { Console.WriteLine("Skriv in din vikt: "); var weight = int.Parse(Console.ReadLine()); Console.WriteLine("Skriv in din längd i meter: "); var length = double.Parse(Console.ReadLine()); BMIClient bmi = new BMIClient(); Console.WriteLine(bmi.CalculateBMI(weight, length)); Console.ReadLine(); }
static void Main(string[] args) { BMIClient host = new BMIClient(); Console.WriteLine("Skriv in längd i centimeter: "); decimal height = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine("Skriv in vikt i kilogram: "); decimal weight = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine(host.BMI(height, weight)); System.Threading.Thread.Sleep(5000); }
static void Main(string[] args) { Console.WriteLine("Skriv in din vikt: "); var weight = int.Parse(Console.ReadLine()); Console.WriteLine("Skriv in din längd i meter: "); var length = double.Parse(Console.ReadLine()); BMIClient bmi = new BMIClient(); Console.WriteLine(bmi.CalculateBMI(weight, length)); Console.ReadLine(); }
static void Main(string[] args) { BMIClient host = new BMIClient(); // proxy översätter //så att jag tror att min klass TextFormatClient är i mitt projekt //Interfacet -> vårt projekt via proxy Console.WriteLine("Vad väger du?"); int weight = Int32.Parse(Console.ReadLine()); Console.WriteLine("Hur lång är du?"); int height = Int32.Parse(Console.ReadLine()); int bmi = host.BMI(height, weight); Console.WriteLine("Ditt BMI är {0}", bmi); Console.ReadLine(); }
protected void Button1_Click(object sender, EventArgs e) { BMIClient host = new BMIClient(); Label1.Text = host.BMI(Convert.ToDecimal(TextBox1.Text),Convert.ToDecimal(TextBox2.Text)).ToString(); }