IfIsLoop
Incorrect
The body of an if statement executes repeatedly, as long as the condition holds
Correct
The body of an if statement executes at most once
CorrectionHere is what's right.
Here is what's right.
The body of an if
-statement either executes,
or it does not execute.
Students might mistake if
-statements for while
-statements.
Conditional: Execute body zero or one times
if (a > 0) {
a = a - 1;
}
Loop: Execute body zero or more times
while (a > 0) {
a = a - 1
}
SymptomsHow do you know your students might have this misconception?
How do you know your students might have this misconception?
- Students claim an
if
-statement means “ensure that this condition holds” - Students claim an
if
-statement “corrects things whenever this condition does not hold”
Language
Java
Concepts
Expressible In
Related Misconceptions
Other Languages
Literature References
The following papers directly or indirectly provide qualitative or quantitative evidence related to this misconception.