Iterations Flashcards
1
Q
How do Iterations function?
A
A loop executes a block of code repeatedly and a termination condition controls how often the loop is executed. They only function if the logical statement inside the parenthesis is true.
2
Q
How does the Do loop function?
A
The loop will continue if the condition at the end is true. Since it is at the end, the loop will always run at least once.
3
Q
How does the For loop function?
A
The loop is better suited if you understand how many times you wish to run it. It contains a variable that ticks and matches an condition.
4
Q
What are the 3 things a For loop consists of?
A
- Initialization Expression (runs before the loop starts)
- Loop Condition
- Incrament/Decrament Expression