calculator method given in
Program 6.12.
The source code for the main method is available here.
The input is a reverse-Polish expression of the following form:
The expression may contain only single-digit integers,
the addition operator +,
and the multiplication operator *.
In addition, the = operator pops the top value of the stack
and prints it on the output screen.
For example, the input 3 4 + = will cause the program
to compute and print 7.