c++ code to convert from infix to post fix

O

ostorat_elwafa2

program that uses a stack to convert a given infix expression to a
postfix expression and then to evaluate it.
program should first check if the infix expression entered has
balanced brackets ( (, [, {, ), ], } ) and if not should produce an
error. The program should handle at least the following operators (+,
-, *, /, %). Assume the operands are single digit integers.
thank you
 
G

Guest

program that uses a stack to convert a given infix expression to a
postfix expression and then to evaluate it.

That is not a correct sentence it is just the end of a sentence, so I
have come up with the following suitable beginning: "Think of a".
program should first check if the infix expression entered has
balanced brackets ( (, [, {, ), ], } ) and if not should produce an
error.

Again, you forgot the beginning of the sentence: "The".
The program should handle at least the following operators (+,
-, *, /, %). Assume the operands are single digit integers.

OK, I am thinking about it.
thank you

No problem, you might also be interested in section 5.2 of the FAQ:
http://www.coders2020.com/cplusplus-explained/how-to-post.html#faq-5.2
 
O

osmium

program that uses a stack to convert a given infix expression to a
postfix expression and then to evaluate it.
program should first check if the infix expression entered has
balanced brackets ( (, [, {, ), ], } ) and if not should produce an
error. The program should handle at least the following operators (+,
-, *, /, %). Assume the operands are single digit integers.


That is a bad assignment and teaches you, by implication, the wrong way to
approach things, it is child like to check for balanced brackets ahead of
time. Be very skeptical of this instructor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top