Need pointers with calculator-like interface

Need pointers from the good folks here.

I need to create an interface illustrated below:

Scenario

  1. When the user clicks either the button 30 or 60, it will update dynamic textfield (value1) with the corresponding value

  2. When the user clicks either the button 45 or 73, it will update dynamic textfield (value2) with the corresponding value

  3. Dynamic textfield (output) will dynamically add the values of ‘value1’ and ‘value2’ and generate the total.

How do I go about scripting the interface?