I believe my program is still going through the if statements after it is declared invalid. It should print invalid filling status or invalid exemption status on the same line w
Edit:
based on the updated question, it is clear that the problem lies not with the horrendous if
statements, but with the input data - you are picking the wrong record as having invalid number of exemptions. This means two things:
you should have posted this earlier and saved people a lot of time looking in the wrong place
you need to show the data that you are consuming if you want an opinion on why you are flagging the wrong record.
I've deleted my original answer. Next time please post ALL the relevant details.