Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
ICS 160E / EECS 114 - Engineering Data Structures and Algorithms- Programming Project 1
Postfix notation is an unambiguous way of writing an arithmetic expression without parentheses. It is defined so that if
exp1 op exp2is a normal fully-parenthesized expression whose operation is op, then the postfix version of this is
pexp1 pexp2 opwhere pexp1 is the postfix version of exp1 and pexp2 is the postfix version of exp2. The postfix version of a single number is just that number. So, for example, the postfix version of
((5+2)*(8-3))^4is
5 2 + 8 3 - * 4 ^Write a Java program that evaluates an expression that is input in postfix notation. Your program should support numbers input as integers or (floating point) doubles, and it should support the following operators:
- +, for addition
- -, for subtraction
- *, for multiplication
- /, for division
- ^, for exponentiation (the power function)