Deck 7: Problem Solving With Loops

Full screen (f)
exit full mode
Question
9.Automatic counter loops should be used only when you do not know how many times the loop should be executed.
Use Space or
up arrow
down arrow
to flip the card.
Question
7.When using a WHILE/WHILE-END instruction,if the condition is false before entering the loop,the loop instructions will still be processed one time.
Question
6.The conditional test is made at the end of the REPEAT/UNTIL instruction.
Question
22.When using the automatic counter loop:

A)The ending value is optional if you have another way to exit the loop.
B)The step value is optional.
C)The starting value is optional.
D)None of the above.
E)All of the above.
Question
12.In an automatic counter loop,the instructions are repeated until:

A)A given condition is true.
B)A given condition is false.
C)The counter becomes larger than the ending number.
D)The counter becomes equal to the ending number.
Question
13.When nesting loops:

A)The outer loop instructions are executed once for every time the inner loop instructions are executed.
B)The inner loop instructions are executed the required times for every time the outer loop instructions are executed once.
C)The outer loop instructions are executed the required time for every time the inner loop instructions are executed.
D)None of the above.
Question
19.Brackets are used in the algorithm of loops:

A)To indicate which instructions are to be repeated.
B)To indicate the beginning and end of the loop.
C)To indicate the entire loop.
D)None of the above.
Question
4.The conditional test is made at the end of the loop in a WHILE/WHILE-END instruction.
Question
20.The start,stop,and step values in an automatic counter loop:

A)Must all be constants.
B)May be constants or variables.
C)Must all be variables.
D)May be constants,variables,or expressions.
E)None of the above.
Question
15.The loop logic structure:

A)Allows decisions to be made.
B)Allows instructions to be repeated.
C)Allows for the execution of multiple paths.
D)All of the above.
Question
8.When using a REPEAT/UNTIL instruction,if the condition is false before entering the loop,the loop instructions will still be processed at least one time.
Question
14.An indicator:

A)Can be a conditional end to the execution.
B)Can be trip value to exit a loop.
C)Can be used in error checking.
D)All of the above.
Question
2.Incrementing is done by adding a variable to another variable.
Question
18.Indentation is used in the algorithm of loops:

A)To indicate which instructions are to be repeated.
B)To indicate the beginning and end of the loop.
C)To indicate the entire loop.
D)None of the above.
Question
10.All loop structures use the diamond in the flowchart to indicate a loop.
Question
What will be printed when the following algorithm is processed?
COUNTER = 0
DISTRIBUTION = 500
WHILE DISTRIBUTION > 200 AND COUNTER < 5
GIVEAWAY = DISTRIBUTION * .5
PRINT GIVEAWAY
DISTRIBUTION = DISTRIBUTION - GIVEAWAY
COUNTER = COUNTER + 1
WHILE-END

A)250
B)250,125
C)150,125,62.5
D)None of the above
Question
1.Accumulating and counting a set of data can be accomplished by using the loop logic structure.
Question
5.When using an automatic counter loop,the counter can be decremented through the use of a negative number for the step.
Question
3.Accumulating allows the developer to total a group of numbers.
Question
11.When using a REPEAT/UNTIL instruction:

A)The condition is executed after the last of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is false and continues with the first of the repeated instruction when the condition is true.
B)The condition is executed after the last of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is true and continues with the first of the repeated instruction when the condition is false.
C)The condition is executed at the beginning of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is false and continues with the first of the repeated instruction when the condition is true.
D)The condition is executed at the beginning of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is true and continues with the first of the repeated instruction when the condition is false.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/20
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Problem Solving With Loops
1
9.Automatic counter loops should be used only when you do not know how many times the loop should be executed.
False
2
7.When using a WHILE/WHILE-END instruction,if the condition is false before entering the loop,the loop instructions will still be processed one time.
False
3
6.The conditional test is made at the end of the REPEAT/UNTIL instruction.
True
4
22.When using the automatic counter loop:

A)The ending value is optional if you have another way to exit the loop.
B)The step value is optional.
C)The starting value is optional.
D)None of the above.
E)All of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
5
12.In an automatic counter loop,the instructions are repeated until:

A)A given condition is true.
B)A given condition is false.
C)The counter becomes larger than the ending number.
D)The counter becomes equal to the ending number.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
6
13.When nesting loops:

A)The outer loop instructions are executed once for every time the inner loop instructions are executed.
B)The inner loop instructions are executed the required times for every time the outer loop instructions are executed once.
C)The outer loop instructions are executed the required time for every time the inner loop instructions are executed.
D)None of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
7
19.Brackets are used in the algorithm of loops:

A)To indicate which instructions are to be repeated.
B)To indicate the beginning and end of the loop.
C)To indicate the entire loop.
D)None of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
8
4.The conditional test is made at the end of the loop in a WHILE/WHILE-END instruction.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
9
20.The start,stop,and step values in an automatic counter loop:

A)Must all be constants.
B)May be constants or variables.
C)Must all be variables.
D)May be constants,variables,or expressions.
E)None of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
10
15.The loop logic structure:

A)Allows decisions to be made.
B)Allows instructions to be repeated.
C)Allows for the execution of multiple paths.
D)All of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
11
8.When using a REPEAT/UNTIL instruction,if the condition is false before entering the loop,the loop instructions will still be processed at least one time.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
12
14.An indicator:

A)Can be a conditional end to the execution.
B)Can be trip value to exit a loop.
C)Can be used in error checking.
D)All of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
13
2.Incrementing is done by adding a variable to another variable.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
14
18.Indentation is used in the algorithm of loops:

A)To indicate which instructions are to be repeated.
B)To indicate the beginning and end of the loop.
C)To indicate the entire loop.
D)None of the above.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
15
10.All loop structures use the diamond in the flowchart to indicate a loop.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
16
What will be printed when the following algorithm is processed?
COUNTER = 0
DISTRIBUTION = 500
WHILE DISTRIBUTION > 200 AND COUNTER < 5
GIVEAWAY = DISTRIBUTION * .5
PRINT GIVEAWAY
DISTRIBUTION = DISTRIBUTION - GIVEAWAY
COUNTER = COUNTER + 1
WHILE-END

A)250
B)250,125
C)150,125,62.5
D)None of the above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
17
1.Accumulating and counting a set of data can be accomplished by using the loop logic structure.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
18
5.When using an automatic counter loop,the counter can be decremented through the use of a negative number for the step.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
19
3.Accumulating allows the developer to total a group of numbers.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
20
11.When using a REPEAT/UNTIL instruction:

A)The condition is executed after the last of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is false and continues with the first of the repeated instruction when the condition is true.
B)The condition is executed after the last of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is true and continues with the first of the repeated instruction when the condition is false.
C)The condition is executed at the beginning of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is false and continues with the first of the repeated instruction when the condition is true.
D)The condition is executed at the beginning of the repeated instructions,at which time the execution continues with the next instruction after the loop when the condition is true and continues with the first of the repeated instruction when the condition is false.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 20 flashcards in this deck.