Java program that reads an arithmetic expression, performs the arithmetic in the expression, and outputs the answer. The expression will be in infix notation, which is the way we normally write them, the program converts the expression to postfix form, performs the calculation on the converted postfix form and outputs the answer. The program will requires two steps, both involving the use of a stack data structure: (1) convert the infix expression to postfix (2) process the postfix expression by computing it and output the result.
ashwinravishankar / calculated-expression Goto Github PK
View Code? Open in Web Editor NEWJava program that reads an arithmetic expression, performs the arithmetic in the expression, and outputs the answer. The expression will be in infix notation, which is the way we normally write them, the program converts the expression to postfix form, performs the calculation on the converted postfix form and outputs the answer. The program will require two steps, both involving the use of a stack data structure: (1) convert the infix expression to postfix, and (2) process the postfix expression by computing it and output the result.