COMP2540-Assignment 2 Program To Evaluate Arithmetic Expressions Represented as Text Solved
For this assignment, you will write a computer program to evaluate arithmetic expressions represented as text (a space-delimited infix expression). For example, the
5. Display the data in the stack before and after each pop and push operation (20 points)
You must handle the unary negation operator. You may use built-in functions in C or Java to handle the power operator (e.g., 2^3 =8) The usual order of operations is in effect:
Your program must read n number of a space-delimited infix expression from an input text file and evaluate them, where each line represents an infix expression.