There may be a better way but you could always use the boolean method isSelected() for the RadioButtons.

Also, how is your formula supposed to work for a range?

if (genderM.isSelected())
{
if...