Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Deadline: September 5th, 2014

Assignment#01

Question: Write a program that convert infix notation into postfix notation and
finally evaluate the expression? Your output should consist of input expression,
followed by its corresponding postfix expression, followed by the answer. The
output (including the original infix expressions) must be clearly formatted (or
reformatted) and also clearly labelled.
Sample output:
Infix:
Postfix:
Answer:

3 + 4 - 1
3 4 + 1
6

Note: Your program should work on any expression.

You must use the linked implementation of the stack. In addition, you must
implement a template, and copy constructor. You must devise a Boolean function
that takes two operators and tells you which has higher precedence. This is helpful
when you need to compare the next input symbol to the top of the stack element.

You might also like