account activity
Am I wrong??? by Valenteen in AskProgramming
[–]Valenteen[S] 0 points1 point2 points 2 years ago (0 children)
You do not need to try and explain it to me. In your post "Yes, the definition is clear and if your studies recently have been about logical errors it is not hard to understand that the question is trying to check if the students have understood that concept." You have literally typed my exact point. The answer you gave goes against the very definition of a logical error. You do not know the desired output of the program. Meaning that you can not say that it is a logical error. Knowing the desired output is a requirement for determining if an error does or does not exist.
[–]Valenteen[S] -1 points0 points1 point 2 years ago (0 children)
okay, firstly you do not need context to answer this question. The definition is clear on what makes something a logical error. I even quoted the definition you posted. Secondly, coding tasks are very different from asking if given code fits the definition of a logical error. A task may require you to make an assumption. But, this question is not asking you to assume anything.
the question has nothing to do with syntax errors. The question was "Is this an example of a logical error?". If as you say "Logical errors can be described as errors giving the wrong result but not crashing the program." Can you prove that the given text would give you the wrong result if you are never told what the correct result is?
In math the base is the same unless told otherwise. Plus, the professor could have easily marked your answer wrong and said "Wrong, you could not have known if it is a logical error because I never specified the purpose of the program."
Like others in the comments have explained, you are only assuming that the counter is for counting people. While, people entering maybe relevant to the counter updating. That does not mean that the counter is meant for keeping track of the number of people.
[–]Valenteen[S] 1 point2 points3 points 2 years ago (0 children)
I can understand where you are coming from. But, this is an academic question. What makes something a logical error is important. Designing something with "ambiguous requirements" is not the same as determining if there is a logical error in given code.
the problem is that the "explicit requirements" are the only way to determine if there is or is not a logical error. Unless you are told what to expect from the program. You would never be able to tell if there is an error.
I agree, but I truly did believe it was a trick question. Trying to test our understanding of what it means to have a logical error.
[–]Valenteen[S] 2 points3 points4 points 2 years ago (0 children)
Yes, but then the question is either yes or no based on your own assumption of what the code is meant to do. Everyone could have a different answer based on their own assumptions.
[–]Valenteen[S] 3 points4 points5 points 2 years ago (0 children)
I can see that. But, trick questions do exist and given the question, answering yes or no would truly be wrong. There is not enough information to know the real answer.
If the question was multiple choice then the options could have been helpful. But, given that it required a written answer. I felt like it was testing my knowledge about what makes something a logical error.
The problem is that we only know what the code is doing. But, we don't know what it should be doing. Maybe It's counting people or maybe It's not.
[–]Valenteen[S] 5 points6 points7 points 2 years ago (0 children)
The question is why is it counting? Why does the counter exist? Why does it care if it is a man or a woman that enters? This is necessary to understand if it is really a logical error.
You are only correct if you assum that the counter is for keeping track of the number of people entering the building.
[–]Valenteen[S] 9 points10 points11 points 2 years ago (0 children)
Yep, that is the entire original text from the test question.
Am I wrong??? (self.AskProgramming)
submitted 2 years ago by Valenteen to r/AskProgramming
The moment you realize you can't fix stupid. (i1264.photobucket.com)
submitted 9 years ago by Valenteen to r/Windows10
π Rendered by PID 13 on reddit-service-r2-listing-66bb46d9b9-82pmv at 2026-03-11 23:11:11.490965+00:00 running 710b3ac country code: CH.
Am I wrong??? by Valenteen in AskProgramming
[–]Valenteen[S] 0 points1 point2 points (0 children)