2.8 Loop and a Half
-
Incorrect
Correct
No Answer was selected
Invalid Answer
Vocabulary
Term | Definition |
---|---|
Loop | A loop is a way to repeat code in your program. |
While Loop | Lets us repeat code as long as something is true. |
Condition | A condition is code that you put inside an if statement or while-loop. |
Sentinel | A constant that has the specific purpose of being the value that breaks out of a loop. |
Control Structure | A control structure lets us change the flow of the code. |
Loop-and-a-half | A loop, most often set with while(true), that has a break in the loop body. |
break statement | The `break;` statement breaks out of the current loop, without executing any more code in the loop. |
Infinite Loop | A loop that has no way of stopping, and will keep looping forever. |