第1个回答 2017-08-18
class cal{
public double cal(double num1,double num2,string oper){
double result = 0;
switch(oper){
case "+":
result = num1 + num2;
break;
case "-":
result = num1 - num2;
break;
case "+":
result = num1 * num2;
break;
case "+":
result = num1 / num2;
break;
}
retrun result;
}
}
第2个回答 2016-03-22
class cal{
public double cal(double num1,double num2,string oper){
double result = 0;
switch(oper){
case "+":
result = num1 + num2;
break;
case "-":
result = num1 - num2;
break;
case "+":
result = num1 * num2;
break;
case "+":
result = num1 / num2;
break;
}
retrun result;
}
}本回答被网友采纳