Microsoft interview question

Simulate an calculator by your code without using eval()