Programming Challenge: Reverse Polish Notation Calculator

Emerald_Knight
Thu, 13 Sep 2018 01:13:54 +0000

It's been nearly a week, so it's time for another programming challenge!

This time, let's create a calculator that accepts reverse Polish notation (RPN), also known as postfix notation.

For a bit of background, RPN is where you take your two operands in an expression and place the operator after them. For example, the expression 3 + 5 would be written as 3 5 +. A more complicated expression like (5 - 3) x 8 would be written as 5 3 - 8 x, or 8 5 3 - x.

All your program has to do is accept a valid RPN string and apply the operations in the correct order to produce the expected result.

Comments URL: https://tildes.net/~comp/6ba/programming_challenge_reverse_polish_notation_calculator

Votes: 18

Comments: 10