Chapter 8 - Definitions Flashcards

1
Q

Define algorithm

A

A step-by-step process for solving a category of problems

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

Define body

A

The indented statements after a heading ending in a colon, for instance after a for-loop heading

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

Define counter

A

A variable used to count something, usually initialized to zero and incremented in the body of a loop

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

Define cursor

A

An invisible marker that keeps track of where the next character will be printed

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

Define definite iteration

A

A loop where we have an upper bound on the number of times the body will be executed. Definite iteration is best coded as a for loop.

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

Define escape sequence

A

An escape character, \, followed by one or more printable characters used to designate a non printable character

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

Define generalise

A

To replace something that is unnecessarily specific (like a constant value) with something appropriately general (like a variable or parameter). Generalisation makes code more versatile, more likely to be reused, and sometimes even easier to write.

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

Define infinite loop

A

A loop in which the terminating condition is never satisfied

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

Define indefinite iteration

A

A loop where we just need to keep going until some condition is met. A while statement is used for this case.

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

Define iteration

A

Repeated execution of a set of programming statements

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

Define loop

A

A statement or group of statements that execute repeatedly until a terminating condition is satisfied

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

Define loop variable

A

A variable used as part of the terminating condition of a loop

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

Define nested loop

A

A loop inside the body of another loop

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

Define newline

A

A special character that causes the cursor to move to the beginning of the next line

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

Define reassignment

A

Making more than one assignment to the same variable during execution of a program

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

Define tab

A

A special character that causes the cursor to move to the next tab stop on the current line