convert the swtich code bellow to "if-else" switch(token){ case "/": result = num1/num2; postfixStack.push(result); break; case "*": result = num1*num2; postfixStack.push(result); break; case "+": result = num1+num2; postfixStack.push(result); break; case "-": result = num1-num2; postfixStack.push(result); break; }
convert the swtich code bellow to "if-else"
switch(token){
case "/":
result = num1/num2;
postfixStack.push(result);
break;
case "*":
result = num1*num2;
postfixStack.push(result);
break;
case "+":
result = num1+num2;
postfixStack.push(result);
break;
case "-":
result = num1-num2;
postfixStack.push(result);
break;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps