Handle calculate button's click event.