Exemplo n.º 1
0
 public static Operation creatOperate(string operate)
 {
     Operation oper = null;
     switch (operate)
     {
         case "+":
             {
                 oper = new OpertionAdd();
                 break;
             }
         case "-":
             {
                 oper = new OpertionSub();
                 break;
             }
         case "*":
             {
                 oper = new OpertionMul();
                 break;
             }
         case "/":
             {
                 oper = new OpertionDiv();
                 break;
             }
     }
     return oper;
 }
Exemplo n.º 2
0
        public static Operation creatOperate(string operate)
        {
            Operation oper = null;

            switch (operate)
            {
            case "+":
            {
                oper = new OpertionAdd();
                break;
            }

            case "-":
            {
                oper = new OpertionSub();
                break;
            }

            case "*":
            {
                oper = new OpertionMul();
                break;
            }

            case "/":
            {
                oper = new OpertionDiv();
                break;
            }
            }
            return(oper);
        }