CS 159 Lab 8 True or False

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

In an event-controlled loop we know the number of times that the actions found inside the body of the loop will

be executed.

F

2
New cards

In a counter-controlled loop we know the number of times that the actions found inside the body of the loop will

be executed.

T

3
New cards

A counter-controlled loop may execute a constant number of iterations.

T

4
New cards

It is possible for the number of times a counter-controlled loop will iterate to depend on the value of a single

variable or expression.

T

5
New cards

The number of times that the loop control expression is evaluated is one more than the number of iterations in a

pretest loop.

T

6
New cards

The for loop is usually used for counter-controlled processes.

T

7
New cards

The ability to complement a logical expression is important because programmers often consider what must

happen for a loop to terminate rather than the conditions that should keep it going.

T

8
New cards

The loop control expression is evaluated before every iteration of a pretest loop, including the first iteration.

T

9
New cards

No semi-colon is used after the loop control expression for a while loop.

T

10
New cards

The first expression in a for loop is to initialize the loop control variable.

T

11
New cards

The second expression in a for loop is the loop control expression.

T

12
New cards

The third expression in a for loop is the update expression that changes the loop control variable.

T

13
New cards

It is not a recommended coding technique to update the loop control variable in the body of a for loop rather

than making use of the third expression.

T

14
New cards

The for loop is used when a loop is to be executed a known number of times.

T

15
New cards

Any statement, even another for loop, can be included in the body of a for loop.

T

16
New cards

The do while loop will test the loop control expression after the execution of the statements found inside the

body of loop.

T

17
New cards

No semi-colon is used after the loop control expression for a do while loop.

F

18
New cards

A semi-colon is used after the loop control expression for a do while loop.

T

19
New cards

The do while loop is commonly used in the process of data validation.

T

20
New cards

Good structured programming practices limit the use of the break command to switch constructs.

T

21
New cards

If you think you need to make use of the continue statement then your algorithm may not be well structured.

T

22
New cards

The efficiency of an algorithm is one measure to determine when one solution should be preferred to another.

T

23
New cards

Functions that make use of loops can vary widely in their efficiency.

T

24
New cards

# of times loop control expression is

evaluated in a Pretest Loop

n + 1

25
New cards

# of times actions inside the body of the loop

are executed in a Pretest Loop

n

26
New cards

Minimum # of times loop is iterated in a Pretest Loop

0

27
New cards

# of times loop control expression is

evaluated in a Post-test Loop

n

28
New cards

# of times actions inside the body of the

loop are executed in a Post-test Loop

n

29
New cards

Minimum # of times loop is iterated in a Post-test Loop

1

30
New cards

The second expression in a for loop is executed prior to every iteration.

T

31
New cards

The do while loop will test the loop control expression after the execution of the statements found inside the body of loop.

T

32
New cards

The for loop is usually applied to event-controlled processes.

F

33
New cards

The number of times that the loop control expression is evaluated is one more than the number of iterations in a post-test loop.

F

34
New cards

The first expression in a for loop is to declare and initialize the loop control variable.

F

35
New cards

Good structured programming practices limit the use of the break command to switch constructs.

T

36
New cards

In an event-controlled loop we know the total number of times that the actions found inside the body of the loop will be executed.

F