コード例 #1
0
ファイル: Program.cs プロジェクト: NellyHaglund/WCF
        static void Main(string[] args)
        {
            BMICalculatorClient host = new BMICalculatorClient();
            Console.WriteLine("Insert you height (meters): ");
            var height = Console.ReadLine();
            Console.WriteLine("Insert your weight: ");
            var weight = Console.ReadLine();

            Console.WriteLine(host.CalculateBMI(float.Parse(weight), float.Parse(height)));
            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            BMICalculatorClient host = new BMICalculatorClient();

            Console.WriteLine("Insert you height (meters): ");
            var height = Console.ReadLine();

            Console.WriteLine("Insert your weight: ");
            var weight = Console.ReadLine();

            Console.WriteLine(host.CalculateBMI(float.Parse(weight), float.Parse(height)));
            Console.ReadLine();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: OnurM/WCF-labs
        static void Main(string[] args)
        {
            var host = new BMICalculatorClient();
            Console.Write("Var vänlig och skriv in din vikt: ");
            var weight = Console.ReadLine().Replace(".",",");
            Console.Write("Var vänlig och skriv in din längd i meter: ");
            var heightInMeters = Console.ReadLine().Replace(".",",");

            var x = 0.0;

            var doubleHeight = double.TryParse(heightInMeters, out x) ? double.Parse(heightInMeters) : 0.0;

            var doubleWeight = double.TryParse(weight, out x) ? double.Parse(weight) : 0.0;

            Console.WriteLine($"Din BMI är: {host.CalculateMyBMI(doubleHeight, doubleWeight).ToString()}");
            Console.ReadKey();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: OnurM/WCF-labs
        static void Main(string[] args)
        {
            var host = new BMICalculatorClient();

            Console.Write("Var vänlig och skriv in din vikt: ");
            var weight = Console.ReadLine().Replace(".", ",");

            Console.Write("Var vänlig och skriv in din längd i meter: ");
            var heightInMeters = Console.ReadLine().Replace(".", ",");

            var x = 0.0;

            var doubleHeight = double.TryParse(heightInMeters, out x) ? double.Parse(heightInMeters) : 0.0;

            var doubleWeight = double.TryParse(weight, out x) ? double.Parse(weight) : 0.0;

            Console.WriteLine($"Din BMI är: {host.CalculateMyBMI(doubleHeight, doubleWeight).ToString()}");
            Console.ReadKey();
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: NellyHaglund/WCF
        private void buttonCalc_Click(object sender, EventArgs e)
        {
            BMICalculatorClient host = new BMICalculatorClient();

            labelResult.Text += host.CalculateBMI(float.Parse(textBoxWeight.Text), float.Parse(textBoxHeight.Text));
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: NellyHaglund/WCF
 private void buttonCalc_Click(object sender, EventArgs e)
 {
     BMICalculatorClient host = new BMICalculatorClient();
     labelResult.Text += host.CalculateBMI(float.Parse(textBoxWeight.Text), float.Parse(textBoxHeight.Text));
 }