A C++ programming exam is probably no place for a subjective question.
A C++ programming exam is probably no place for a subjective question.
Mainframe assembler programmer by trade. C coder when I can.
I don't know. Don't find it that subjective. But one can also argue you find subjectivity in many aspects of C++ programming. So...
In any case, these type of questions do make sense to me. Particularly on a basic level such as the one this exam clearly aims at. And the answer is usually an easy exercise of simply excluding the wrong possibilities and finding the encompassing one in case more than one option is right:
I'm sure some of you will help me with the logic rule name that validates my claim. But regarding the professor, laserlight might be right. Out of simple curiosity though, keep us posted citizen.Code:D = A AND B. Since A and B are right answers, D is the only possible answer. Ignoring either A or B is an error. EDIT: Remember, the question makes no assumptions as to either A or B. So we must assume both are valid.
Last edited by Mario F.; 11-21-2008 at 08:24 AM.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
>> I'm not sure how, citizen.
The problem is that you're a reasonable person, Mario, who doesn't have anything riding on the test.
People who when they think they know a lot about something and are contradicted with proof on their speciality tend to become defensive, and from my experience, curl up into a ball, ignore the problem and hope the complainer dies or leave the matter rest. However, if one as determined and wronged as I were to not let it go one would be informed of a curious phenomenon computer error which cause your score (and only your score) to be in error, your score is remedied and hey presto, your score wasn't changed until the second visit to the grader...
I was going to wait until there was some sort of announcement before I posted, but my professor wrote me back. She agreed that my answers were marked wrong and corrected my score. She said she would double check to see what the cause of the problem is, so unfortunately I don't know the cause yet. She thanked me.
Considering I was likely the first to take the midterm, she may have simply corrected the master answer key so that no one else has the same problems and won't announce it. I'm thinking that this is a simple mistake as the lecture material never taught such silly answers.
Also, with those points back, I now have an A. Worth it indeed.
Clearly your professors aren't nearly as cynical as some of mine. Lucky man!
Congratz with the A
But that first question thing is so simple that even I can do it o.O ... How can someone possible do that wrong?
Currently research OpenGL
There's so many things that can go wrong with that question.
For one, as citizen made a point to signal, cin isn't defined. Naturally we assume std::cin, but it could be a user-defined type or a native type. Even if a user-defined stream or a native type, there's no guarantee the << operator hasn't been overloaded and what it does.
But, even if std::cin, we could add a twist and mention the possibility of a macro validating both forms, or the possible presence of another << overload.
Of course the answer can only be one, giving the question.
But when arguing with your professor, you better cover all the basis.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
If I was your professor I wouldn't have given you points back on the first one. You assumed that cin was the same as std::cin, but it does not have to be, and if it wasn't there is nothing that says it *can't* compile:
maybe i'm a ... donkey ... but I can respect the fact that he wrote a good trick question.Code:class mycin { public: int val; void operator>>(int v) { val = v; } } cin; void operator>>(int v, mycin& c) { c.val = v; } int main () { cin >> 5; 5 >> cin; return 0; }
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
>> You assumed that cin was the same as std::cin
It was correct to do so given how the question was actually written on the exam. I made an earlier post quoting the email I sent my professor: those questions were directly copied from the exam.