CS 159 Lab 8 True or False

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 35

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

36 Terms

1

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

New cards
2

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

New cards
3

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

T

New cards
4

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

New cards
5

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

pretest loop.

T

New cards
6

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

T

New cards
7

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

New cards
8

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

T

New cards
9

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

T

New cards
10

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

T

New cards
11

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

T

New cards
12

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

T

New cards
13

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

New cards
14

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

T

New cards
15

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

T

New cards
16

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

body of loop.

T

New cards
17

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

F

New cards
18

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

T

New cards
19

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

T

New cards
20

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

T

New cards
21

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

T

New cards
22

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

T

New cards
23

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

T

New cards
24

# of times loop control expression is

evaluated in a Pretest Loop

n + 1

New cards
25

# of times actions inside the body of the loop

are executed in a Pretest Loop

n

New cards
26

Minimum # of times loop is iterated in a Pretest Loop

0

New cards
27

# of times loop control expression is

evaluated in a Post-test Loop

n

New cards
28

# of times actions inside the body of the

loop are executed in a Post-test Loop

n

New cards
29

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

1

New cards
30

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

T

New cards
31

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

T

New cards
32

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

F

New cards
33

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

New cards
34

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

F

New cards
35

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

T

New cards
36

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

New cards

Explore top notes

note Note
studied byStudied by 6 people
888 days ago
5.0(1)
note Note
studied byStudied by 13 people
330 days ago
5.0(1)
note Note
studied byStudied by 4 people
839 days ago
5.0(1)
note Note
studied byStudied by 1 person
809 days ago
5.0(1)
note Note
studied byStudied by 1 person
58 days ago
5.0(1)
note Note
studied byStudied by 8 people
788 days ago
5.0(1)
note Note
studied byStudied by 165 people
115 days ago
4.0(1)

Explore top flashcards

flashcards Flashcard (37)
studied byStudied by 16 people
792 days ago
4.7(3)
flashcards Flashcard (130)
studied byStudied by 3 people
672 days ago
5.0(1)
flashcards Flashcard (49)
studied byStudied by 4 people
120 days ago
5.0(1)
flashcards Flashcard (88)
studied byStudied by 170 people
547 days ago
5.0(3)
flashcards Flashcard (57)
studied byStudied by 1 person
29 days ago
5.0(2)
flashcards Flashcard (77)
studied byStudied by 8 people
493 days ago
5.0(1)
flashcards Flashcard (24)
studied byStudied by 3 people
833 days ago
5.0(1)
flashcards Flashcard (163)
studied byStudied by 185 people
421 days ago
5.0(1)
robot