21

So I have too many posts for wk110. It's sad. Here we go. I got a bad grade on an assignment for a hello world program in college. How do you write a hello world program that successfully prints hello world and not get 100 percent?

The teacher insisted that we write a console "hello world" program in C++, on windows. If he can't read hello world, you fail. So you must add `system("pause")` at the end so the window stays open. One problem: system() is horribly insecure and im stubborn. I refused to write exactly what he wanted, like everyone else did, because I try to not write code I know is unsafe. So I ended my script with cin.get() which also pauses for input. Unlike pause however it can't be any key, it reads a line, so you must hit enter. This was "unfavorable behavior" and ultimately I got something like a high C, low B grade. Only person to not get 100%

Comments
  • 5
    Jesus. The teacher couldnt just run them in a command prompt?
  • 1
    Wasn't the most correct way to cout,flush and cin.ignore? haven't done much C++ dev, but remember reading it somewhere
  • 2
    @JoshBent I think I did use cin.ignore() when I got better but cin.sync(); cin.getc() assigned to a throw away stack variable does essentially the same (except for wasting a byte and a few cycles)
  • 1
    It's just a hello world. I get that your professor was a dick in this situation. But you could have just done it his way for a free grade.
  • 1
    @ODXT I could have but I didn't for two reasons:

    He treated people like morons, and everyone was reciting his crap back from his book (yes he taught from a book he wrote. Egomaniac) I wanted to show him I was thinking for myself.

    He also teaches security so I wanted to show him that as a security teacher, his own book was littered with vulnerabilities in even the simplest of programs.
  • 1
    @deadPix3l
    I understand what you're saying. But antagonizing the professor might not be a good idea. You can show him your skills in different ways.
  • 1
    @ODXT agreed. But it was college and I was 17. That age when you're better than. Everyone else and antagonize anyone. Ehh. Mistakes. Still, marking someone down for thinking in a programming class. Lame.
  • 0
Add Comment