Beispiel #1
0
        private void btnigual_Click(object sender, EventArgs e)
        { // Programando o botão de = com base nas classes criadas //
            segundo = double.Parse(tbxScreen.Text);

            double Som;
            double Su;
            double Mul;
            double Div;

            switch (operador)
            {
            case "+":
                Som            = obj.Somar((primeiro), (segundo));
                tbxScreen.Text = Som.ToString();
                break;

            case "-":
                Su             = obj2.subtracao((primeiro), (segundo));
                tbxScreen.Text = Su.ToString();
                break;

            case "*":
                Mul            = obj3.Multiplicao((primeiro), (segundo));
                tbxScreen.Text = Mul.ToString();
                break;

            case "/":
                Div            = obj4.Divisao((primeiro), (segundo));
                tbxScreen.Text = Div.ToString();
                break;
            }
        }
Beispiel #2
0
        private void btnEqual_Click(object sender, EventArgs e)
        {
            second = double.Parse(tbxScreen.Text);

            double Su;
            double Mi;
            double Mu;
            double Di;

            switch (operation)
            {
            case "+":
                Su             = obj.Sum((first), (second));
                tbxScreen.Text = Su.ToString();
                break;

            case "-":
                Mi             = obj2.Minus((first), (second));
                tbxScreen.Text = Mi.ToString();
                break;

            case "*":
                Mu             = obj3.Multiply((first), (second));
                tbxScreen.Text = Mu.ToString();
                break;

            case "/":
                Di             = obj4.Divide((first), (second));
                tbxScreen.Text = Di.ToString();
                break;
            }
        }