Providing a user with a non-numerical calculated answer using the input variables from a form

Hello,

I have created a form and have linked it to a database. I wanted to provide an output answer on the webpage based on conditions of the input variables i.e.

If input variable 1 = U3 and input variable 3 = Thy3f then output answer = hemithyroidectomy

Does anyone have any suggestions for

  1. adding the output answer into the database
  2. Syncing this output answer for an individual form to the webpage

Thank you for any help!