If the story is in fact real, I would say the student's "fault" here is in not going a bit farther than "oh my god, I just can't get it to work."
He/she could have written:
(1) What have they tried
(2) What errors were they getting (Compiler errors are ROUGH for someone just starting to code. That trivial missing semicolon can waste hours.)
(3) What ideas they might pursue to get it working
I've taught programming to several friends in the past (and I've also seen many other friends drop out of CS in frustration.) It seems that teaching just how to formulate such questions and walk through "what exactly does not work" is a critical step to CS education that is omitted in curricula out there.