chapter 5 Flashcards

1
Q

counter-controlled while loop

A
  • “while” loop that is used when you know how many items of data are to be read
  • the loop will continue until the condition designated by the counter is met or evaluates to “false”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

decision maker

A

an expression in an “if” statement, which determines whether to execute the statement that follows it

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

divisor

A

suppose that M and N are integers and M is nonzero. then M is called a divisor of N if N=MT for some integer T; that is, when M divides N, the remainder is 0

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

End-of-File (eof) controlled “while” loop

A

a “while” loop that stops when it reaches “|” at the end of the input file

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

Fibonacci number

A

a number in the Fibonacci sequence

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

Fibonacci sequence

A

a (sub) n = a (sub) n-1 + a (sub) n-2

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

flag variable

A

a Boolean variable used to control the execution of a “while” loop

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

flag-controlled “while” loop

A

uses a Boolean variable to control the execution of the loop

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

“for” loop (indexed loop)

A
  • used to simplify the writing of counter-controlled loops

- consists of an initialization statement, the loop condition, and the update statement

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

“for” loop control variable

A
  • a loop control variable in a “for” loop

- also called an indexed variable

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

infinite loop

A

a loop that continues to execute endlessly

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

loop control variABLE (LVC)

A

variable that controls the end of the loop

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

nesting

A

process that involves putting one control structure inside another

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

postest loop

A

a loop in which the loop condition is evaluated before executing the body of the loop

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

sentinel

A

an arbitrary value used to stop the execution of a loop

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

sentinel-controlled “while” loop

A

a “while” loop that uses a sentinel value to end the loop