Simple calculator

Can anyone show how to write a simple calculator?

For example, a user is asked to key in 2 values in 2 text input fields and when they hit the on-screen button, the value is returned to a 3rd text field.