Create click event and logic to perform the calculation