public static Operation CreateOperate(string operate) { Operation operation = null; switch (operate) { case "+": { operation = new OperationAdd(); break; } case "-": { operation = new OperationSub(); break; } case "*": { operation = new OperationMul(); break; } case "/": { operation = new OperationDiv(); break; } } return(operation); }
public static Operation CreateOperate(string operate) { //根据传入的参数operate选择实例化的类 Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; } return(oper); }
public static Operation createOperation(string operate) { Operation operation = null; switch (operate) { case "+": operation = new OperationAdd(); break; case "-": operation = new OperationMinus(); break; case "*": operation = new OperationMulti(); break; case "/": operation = new OperationDivision(); break; default: throw new Exception("錯誤:請輸入加減乘除!!"); } return(operation); }
public static Operation CreatOperate(string operate) { Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; default: throw new Exception("input error"); } return(oper); }
public static Operation CreateOperation(string operate) { Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; default: oper = null; break; } return(oper); }
public static Operation CreateOperation(string strOperation) { Operation operation = null; switch (strOperation) { case "+": operation = new OperationAdd(); break; } return(operation); }
public static Operation CreateOperate(string operate) { Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; } return(oper); }
public static Operation CreateFactory(string operation) { Operation oper = null; switch (operation) { case "+": { oper = new OperationAdd(); break; } case "-": { oper = new OperationSub(); break; } case "*": { oper = new OperationMul(); break; } case "/": { oper = new OperationDiv(); break; } case "sqr": { oper = new OperationSqr(); break; } case "sqrt": { oper = new OperationSqrt(); break; } case "+/-": { oper = new OperationReverse(); break; } } return(oper); }
public static Operation CreateOperation(string op) { Operation oper = null; switch (op) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; } return oper; }
public static Operation createOperate(string operate) { Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; case "sqr": oper = new OperationSqr(); break; case "sqrt": oper = new OperationSqrt(); break; case "+/-": oper = new OperationReverse(); break; } return(oper); }
public static Operation CreateOperation(String operation) { Operation o = null; switch (operation) { case "+": o = new OperationAdd(); break; case "-": o = new OperationSub(); break; case "*": o = new OperationMul(); break; case "/": o = new OperationDiv(); break; } return(o); }
public static Operation createOperate(string operate) { Operation oper = null; switch (operate) { case "+": oper = new OperationAdd(); break; case "-": oper = new OperationSub(); break; case "*": oper = new OperationMul(); break; case "/": oper = new OperationDiv(); break; case "sqr": oper = new OperationSqr(); break; case "sqrt": oper = new OperationSqrt(); break; case "+/-": oper = new OperationReverse(); break; } return oper; }