Campbell Ritchie wrote:You need to pass values to the add method, and that returns a result.
Are you sure you should have an Add class, rather than an Arithmetic class with a (static) add method?
This is definitely the way to go for all of your supported calculator operations.
Reorganizing the stack from the user input can be quite tricky though when using
infix notation. It might be a lot easier to enhance functionality step by step using
Reverse Polish Notation (RPN) internally.
You might wanna have a look
here.
Good luck and please keep us posted
Matt