Your code is quite confusing.
I think it would help if you wrote out in English what you want the program to do.
Here are some issues I see right off the bat, but I don't think this will help you any since your do whiles are incorrect imo.
Code
if (code < 10000 && code > 99999)
I'd like to see a number that is both less than 10000 and greater than 99999

I think you meant || (or) here.
Also, make sure to initialize validCode = 1;