The problem is just in the way he's executing his code.
If he actually opens up the command prompt, THEN runs the code, the command prompt will stay up. If he just runs his code (clicks the exe or whatever) then Windows grabs the file, executes it, and then terminates when it needs to. Which is what it is doing. It brings up the command prompt to throw out the user text echos, and then since the program has nothing else to do, closes the command prompt.
It's just the way Windows works. This isn't a fault in his code.
He can put a loop or pause or whatever in his code to hold things, which means Windows doesn't see that the program ended and thus the command prompt stays open. But that's just a work-around for an execution problem, not a code problem.
If he doesn't want the window to close right away, he should run the code properly.