5: Loops And Iterations Flashcards

0
Q

Accumulator

A

A variable used in a loop to add up or accumulate a result.

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

Name the 5 loop patterns described in this chapter.

A
Updating variables (x+1)
While (T/F)
Infinite loops - break
Continue (segment execution)
Definite loops using for/in (set)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Counter

A

A variable used in a loop to count the number or times something happened. We initialize a counter to zero and then increment the counter each time we want to ‘count’ something.

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

Decrement

A

An update that decreases the value of a variable.

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

Initialize

A

An assignment that gives an initial value to a variable that will be updated.

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

Increment

A

An update that increases the value of a variable (often by one).

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

Infinite loop

A

A loop in which the terminating condition is never satisfied or for which there is no termination condition.

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

Iteration

A

Repeated execution of a set of statements using either a recursive function call or a loop.

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