welcome to LQ. Usually people don't answer homework questions here, but I think the way you have asked this one is ok
(ie you've had a good go at it, written some code and are now stuck).
From I quick glance or your code I can see a couple of problems
For instance you have:
if ( gender == 'M' || 'm' && yr <= 2012)
In this the || will not work the way you seem to expect. I think what you want is:
if ( (gender == 'M' || gender == 'm') && yr <= 2012)
There are two things here:
1. You need to include the equality test for both 'M' and 'm"
2. When using an || like this you need to be careful that the && is evaluated: hence the brackets.
Additionally I don't think the ^ operator does what you expect.
PS. Next time you post such a question, please tell us what happens when you run the code, and why the output is not as you expected.