Simulates a simple calculator.