1. What can we do with the while statement?
if what is specified is true, then the following code block should be executed
2. What value needs the statement in the brackets evaluate to in order for the loop to continue?
true
3. What is an infinite loop?
a loop that repeats itself without pause, which should be avoided
4. What is an iteration?
Iteration statements cause statements (or compound statements) to be executed zero or more times, subject to some loop-termination criteria. . C++ provides four iteration statements — while, do, for, and range-based for.
1. When is it a good idea to use a for statement (do a for loop) instead of the while loop we learned previously?
if we know how often we have to iterate over the object
2. How would you write a for-loop in code?
for ( statement 1 ; statement 2 ; statement 3 ) {
// code block to be executed
}
https://www.w3schools.com/cpp/cpp_for_loop.asp (nice doc)
3. What is an off-by-one error?
the loop is executed once too much or once too little due to an error in the initial value or in the final value