CSC 351 - Chapter 8 Flashcards

0
Q

selection statement

A

provides a way of choosing between two or more execution paths

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

control structure

A

a control statement and the collection of statements whose execution it controls

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

multiple-selection statement

A

allows the selection of one of any number of statements ( switch statement)

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

iterative statement

A

causes a statement to be executed zero, one or more times. often called a loop

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

loop variable

A

where the count value is maintained

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

how do functional languages control repetition?

A

instead of iteration, they use recursion

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

what is a block?

A

is a sequence of code that can be used with specially written methods to create useful constructs

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

selection statement design issues

A
  • what is the form and type of the expression that controls the selection?
  • how are the then and else clauses specified?
  • how should the meaning of nested selectors be specified?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

iterative counter-controlled statement design issues

A
  • what are the type and scope of the loop variable?
  • should it be legal for the loop variable/parameters to be changed in the loop?
  • should the parameters be evaluated only once, or once for every iterations?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

solution for nesting two-way selectors

A

use a static semantics rule rather than a syntatic entity

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

iterative statement design issues

A
  • how is iteration controlled?

- where should the control mechanism appear in the loop

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

multiple selection statement design issues

A
  • what is the form and type of the expression that controls the selection?
  • how are the selectable segments specified?
  • is execution flow through the structure restricted?
  • how are the case values specified?
  • how should unrepresented selector expression values be handled?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

pretest loop

A

the test for loop completion occurs before the loop body is executed

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

posttest loop

A

the test for loop completion occurs after the loop body is executed

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

logically controlled loops design issues

A
  • should the control be pretest or posttest?

- should the logically controlled loop be a special form of a counting loop or a separate statement?

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

purpose of user located loop control statements

A

allow programmers to choose a location for loop control other than the top or bottom of the body (break, goto)

16
Q

user located loop control mechanism design issues

A
  • should the conditional mechanism be an integral part of the exit?
  • should only one loop body be exited?
17
Q

unconditional branch statement

A

transfers execution control to a specified location in the program