Tencent Interview Question

Q: How to code a calculator?