Esempio n. 1
0
        void BtnMultiplication_Clicked(object sender, EventArgs e)
        {
            int num1 = checkEditText(edtFirstNumber);
            int num2 = checkEditText(edtSecondNumber);

            var result = myMathFuncs.Multiply(num1, num2);

            txtResult.Text = "Result : " + result;
        }
        private void TestMathFuncs()
        {
            var numberA = 1;
            var numberB = 2;

            // Test Add function
            var addResult = myMathFuncs.Add(numberA, numberB);

            // Test Subtract function
            var subtractResult = myMathFuncs.Subtract(numberA, numberB);

            // Test Multiply function
            var multiplyResult = myMathFuncs.Multiply(numberA, numberB);

            // Test Divide function
            var divideResult = myMathFuncs.Divide(numberA, numberB);

            // Output results
            Debug.WriteLine($"{numberA} + {numberB} = {addResult}");
            Debug.WriteLine($"{numberA} - {numberB} = {subtractResult}");
            Debug.WriteLine($"{numberA} * {numberB} = {multiplyResult}");
            Debug.WriteLine($"{numberA} / {numberB} = {divideResult}");
        }