Need help with a JavaScript code

I am looking to write a script in JavaScript, that will allow me to solve an equation, based on the response a user chooses by entering a numeric value in “type text form”, and by clicking a radio button on a form sheet. example: If the user clicks “yes”, the response will equal 5, if the user chooses “no”, the response will equal 0.

(“user’s inputted numeric entrance” * 2 ) + (“user’s radio button choice”) = x

Thank you for your response. I will complete the JavaScript lessons, and hope to solve the problem.