Make a Reverse Polish Notation calculator with variables. We went through the implementation of an RPN calculator in class. Make it into a complete C++ program and make sure it works properly. Make it work for doubles, not just ints. Get the basics (first set of examples) to work first, then add variables and function calls. Here's a small sample of the sort of thing that should work: (The dots at the end of each RPN expression are to mark the end of the expression) 1 2 3 4 5 + + + + . result is 15 12.3 45.6 + . result is 57.9 1 2 + 3 + 4 + 5 + 10 / . result is 1.5 1 2 * 3 4 * + 5 + . result is 19 1 2 + 3 4 + * 5 * . result is 105 Your program should be crash-proof. That means that it should continue running and only give correct results no matter what bad inputs the user provides. Variables require two new forms to be added to the notation. If you ever see anything that begins with a letter in the input, assume it is the name of a variable. Just push on to the stack the value of that variable: x x 3 * * y 2 * + . That should work out 3 x squared plus 2 y. If you ever see an = in the input, it will be followed by a string, and it represents an assignment. Take the top thing from the stack (but don't remove it) and make the variable named by the string have that value. If the variable has been seen bfeore, you are just updating its value. If you haven't seen this variable name before, create it. 3.14159 = x . result is 3.14159 6.5 * 8 = y . result is 52 x x 3 * * y 2 * + . result is 133.6087631843 2 4 + = six 1 six + + . result is 13 And finally functions: not difficult at all. Now, when you see something that begins with a letter, you don't immediately know whether it is a variable or a function. So your conditional must check against function names before checking for a variable. You only need to include a few functions. Make sure you have at least sqrt, factorial, sin, and cos. When you see a function name, only remove one number from the stack, apply the function to it, and push the result back. 2 8 * sqrt . result is 4 5 factorial 1 + . result is 121 2 x * sin y 2 / cos * . result is whatever the sine of 2x times the cosine of half y happens to be Don't forget about error-proof-ness. You can decide for yourself how to handle factorial when the value isn't a whole number.