• The site migration is complete! Hopefully everything transferred properly from the multiple decades old software we were using before. If you notice any issues please let me know, thanks! Also, I'm still working on things like chatbox, etc so hopefully those will be working in the next week or two.

Anybody understand Postfix expressions

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.
 


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.
 
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?
 
Back
Top