예제 #1
0
 private void EqualsOperation(object sender, EventArgs e)
 {
     if (operation == "+")
     {
         _uppertablelayout.OutputTextBox.Text = (ArithmaticOperations.Add(value, double.Parse(_uppertablelayout.OutputTextBox.Text))).ToString();
     }
     else if (operation == "-")
     {
         _uppertablelayout.OutputTextBox.Text = (ArithmaticOperations.Subtract(value, double.Parse(_uppertablelayout.OutputTextBox.Text))).ToString();
     }
     else if (operation == "*")
     {
         _uppertablelayout.OutputTextBox.Text = (ArithmaticOperations.Multiply(value, double.Parse(_uppertablelayout.OutputTextBox.Text))).ToString();
     }
     else if (operation == "/")
     {
         _uppertablelayout.OutputTextBox.Text = (ArithmaticOperations.Divide(value, double.Parse(_uppertablelayout.OutputTextBox.Text))).ToString();
     }
     operator_pressed = false;
     value            = double.Parse(_uppertablelayout.OutputTextBox.Text);
     operation        = "";
 }
예제 #2
0
 public double Calculate()
 {
     return(ArithmaticOperations.Add(_num1, _num2));
 }