Debugging is an art in itself. To debug this type of problem I'd consider any and/or all of the following until I figured it out:
1) start commenting out one section of the if/else statements at a time to see where the second request statement is coming from, or
2) I'd toss in debugging code that I'd remove once the problem was found. This is usually a cout statement telling me where I am in the code such as "checking for E/e", "too long", "too short", "illegal char input", etc. This way I can see which debugging statement precedes the undesired request for input statement and then I could figure out why it's do this; or
3) I'd comment out everything but the first if statement and the final else adding the internal logic blocks back one at a time to see when the second request for input appears. This mimics writing the code and testing after adding each logic segment to the code, which is probably the best thing to do.
I'm no Picazzo, but this grind it through technique usually get's the job done for me.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005