Iterations Flashcards

You may prefer our related Brainscape-certified 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 3 things a For loop consists of?

A
  1. Initialization Expression (runs before the loop starts)
  2. Loop Condition
  3. Incrament/Decrament Expression
How well did you know this?
1
Not at all
2
3
4
5
Perfectly