Re: Anybody understand Postfix expressions
Quote:
Originally Posted by
DrunkieTheBear
Cause they are actually kicking my ass....
Here's the expression:
70 14 4 5 15 3 / * - - / 6 + =
I came up with -18
Work:
(70 / 14) - 4 - 5 * (15 / 3) + 6
(5) - 4 - 5 * (5) + 6
1 - 25 + 6
-24 + 6
-18
Anybody got any input?
You guys are funny. For the original question, not sure if the others were just BSing cause they didn't show their work like you. I havn't done postfix expressions or reverse Polish ( I guess Polish are backwards LOL), but I'm really good with math, Algebra and the sorts. I havn't done programming since I was in school, but if you post a similar length problem from a text book with the answer. I'm pretty sure I can figure this one out. Googling, I only found problems with about 4 numbers. If I figure it out before you post something from a book, I'll post again. Your work looks good using PEMDAS, but I don't know how to translate to the first line of your work.
Re: Anybody understand Postfix expressions
Super-honest, the calculator is never wrong. Always check your work with a calculator.
Re: Anybody understand Postfix expressions
Quote:
Originally Posted by
SlowNA06
Super-honest, the calculator is never wrong. Always check your work with a calculator.
Ah, didn't know you guys were using calculators. We weren't allowed. I always had to write it out to show how I got the answer even if I did it in my head.
Re: Anybody understand Postfix expressions
Non-scientific calculators don't take in to consideration the order of operations.
anyways, I got my homework back and I had it right along with all the other postfix expressions on the homework.
Who wants to do my Stacks and Queues Coding?