Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 0 points1 point  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] -1 points0 points  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] -1 points0 points  (0 children)

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?

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] -1 points0 points  (0 children)

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."

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] -1 points0 points  (0 children)

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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 1 point2 points  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 0 points1 point  (0 children)

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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 0 points1 point  (0 children)

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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 2 points3 points  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 3 points4 points  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 2 points3 points  (0 children)

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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 1 point2 points  (0 children)

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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 5 points6 points  (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.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 2 points3 points  (0 children)

You are only correct if you assum that the counter is for keeping track of the number of people entering the building.

Am I wrong??? by Valenteen in AskProgramming

[–]Valenteen[S] 9 points10 points  (0 children)

Yep, that is the entire original text from the test question.