Exemplo n.º 1
0
        public void Process(operands Op)
        {
            switch (Op.Operator)
            {
                case "+": this.Add(Op); break;
                case "-": this.Minus(Op); break;
                case "*": this.Multiply(Op); break;
                case "/": this.Division(Op); break;

                default: break;
            }
        }
Exemplo n.º 2
0
 public void Multiply(operands Op)
 {
     Op.result = Op.firstOperand * Op.secondOperand;
 }
Exemplo n.º 3
0
 public void Division(operands Op)
 {
     Op.result = Op.firstOperand / Op.secondOperand;
 }
Exemplo n.º 4
0
 public void Minus(operands Op)
 {
     Op.result = Op.firstOperand - Op.secondOperand;
 }
Exemplo n.º 5
0
 public void Add(operands Op)
 {
     Op.result = Op.firstOperand + Op.secondOperand;
 }