This is one of the weirder things I've seen. I'm teaching an intro C++ course at a university, and one of my students contacted me saying that his code was running forever without stopping. I briefly glanced over his code during class, and didn't see anything immediately obvious, so I had him email me his code.
Without making any changes, I downloaded and ran his code on my machine - and it worked fine. The only difference that I can see is that I'm using OSX, whereas he is using Windows.
Here's the code: http://pastie.textmate.org/private/9rzpttixnuhudsvsm1yl4q
Any ideas?
SOLVED: PEBKAC Abides
The issue actually had to do with what the student was typing. It simply never occured to me to try and enter a string when prompted for the deposit.
As an aside, regarding a disparaging comment made about the "quality" of programmers coming out universities these days: I'm not sure if that comment was directed at me, or at my student, but I'd like to briefly address both perspectives.
Assuming it was directed at me: I'm a TA for the course, not the main lecturer, and I'm responsible for teaching the lab assignments. So, by "teaching an intro C++ course," I meant "teaching material that's covered in the lab assignments." Regarding my own background and experience, I have to admit I'm feeling somewhat slighted. I am, first and foremost, an AI researcher, working in an area which is mostly theory (read: logic and math), where I don't have to write C++ code. The entire reason I posted this question to Stack Overflow was because I've always found helpful and creative solutions here. I thought to myself, "there's some weirdness here that I don't immediately see, but not to worry, the guys on SO have got this."
All that to say: I'm doing everything I can to help these kids learn the material, and well. That attitude helps nothing and no one.
Assuming it was directed at my student: c'mon, really? He's not even a CS major, and this assignment was from the third week of class - his third week of programming of any kind, ever. I'd rather not discourage him this early in the game.