Filters
Question type

Study Flashcards

It is the programmer's responsibility to initialize all variables that must start with a specific value.

A) True
B) False

Correct Answer

verifed

verified

____ is a technique with which you try to prepare for all possible errors before they occur.


A) Incrementing
B) Stub
C) Nested loop
D) Defensive programming

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

A(n) ____ is any numeric variable you use to count the number of times an event has occurred.


A) accumulator
B) key
C) index
D) counter

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

You can either increment or decrement the loop control variable.

A) True
B) False

Correct Answer

verifed

verified

When one loop appears inside another, the loop that is contained is called the ____________________ loop.

Correct Answer

verifed

verified

What are the tasks performed by the for count = 0 to 3 statement?

Correct Answer

verifed

verified

This for statement accomplishes several ...

View Answer

A(n) ____ loop executes a predetermined number of times.


A) terminal
B) definite
C) indefinite
D) infinite

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Once your logic enters the body of a structured loop, ____.


A) the entire loop must execute
B) the loop can be terminated with a break statement
C) the loop will execute indefinitely
D) a decision statement will be evaluated

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

In a ____, the loop body might never execute because the question controlling the loop might be false the first time it is asked.


A) summary report
B) pretest loop
C) posttest loop
D) loop control

E) B) and C)
F) C) and D)

Correct Answer

verifed

verified

Adding to a variable is called ____________________ the variable.

Correct Answer

verifed

verified

Many loop control variable values are altered by ____, or adding to them.


A) incrementing
B) decrementing
C) accumulating
D) deprecating

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

Match each term with a statement below.

Premises
To add to a variable
A variable that you use to gather values
To decrease a variable's value
Initialized before entering a while loop
One set of instructions that operates on multiple, separate sets of data
Any numeric variable you use to count the number of times an event has occurred
The amount by which a for loop control variable changes
Loops within loops
A loop that may execute a different number of times each time the program executes
To override incorrect data by setting the variable to a specific, predetermined value
Responses
accumulator
step value
nested loops
loop
forcing
increment
counter
indefinite
decrement
loop control variable

Correct Answer

To add to a variable
A variable that you use to gather values
To decrease a variable's value
Initialized before entering a while loop
One set of instructions that operates on multiple, separate sets of data
Any numeric variable you use to count the number of times an event has occurred
The amount by which a for loop control variable changes
Loops within loops
A loop that may execute a different number of times each time the program executes
To override incorrect data by setting the variable to a specific, predetermined value

A comparison is correct only when the correct ____ and operator are used.


A) expression
B) operands
C) statements
D) index

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

A mistake programmers often make with loops is that they ____.


A) initialize the loop control variable prior to entering the loop body
B) increment the loop control variable inside of the loop body
C) include statements inside the loop that belong outside the loop
D) enclose the inner loop entirely within the outer loop in a nested loop

E) All of the above
F) A) and C)

Correct Answer

verifed

verified

A mistake programmers often make with loops is that they ____.


A) neglect to initialize the loop control variable prior to entering the loop body
B) increment the loop control variable inside of the loop body
C) validate data to ensure values are the correct data type or that they fall within an acceptable range
D) enclose the inner loop entirely within the outer loop in a nested loop

E) B) and D)
F) A) and C)

Correct Answer

verifed

verified

In some cases, a loop control variable does not have to be initialized.

A) True
B) False

Correct Answer

verifed

verified

Loops are frequently used to ____; that is, to make sure it is meaningful and useful.


A) validate data
B) restructure data
C) simulate data
D) corroborate data

E) All of the above
F) B) and D)

Correct Answer

verifed

verified

You usually use the for loop with ____ loops.


A) indefinite
B) definite
C) inner
D) outer

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

When one loop appears inside another, the loop that contains the other loop is called the ____ loop.


A) indefinite
B) definite
C) inner
D) outer

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

The first step in a while loop is typically to ____.


A) compare the loop control variable to a constant value
B) initialize the loop control variable
C) increment the loop control variable
D) execute the body of the loop

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

Showing 21 - 40 of 51

Related Exams

Show Answer