Deck 5: Repetition Structures
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/20
Play
Full screen (f)
Deck 5: Repetition Structures
1
Because programmers commonly need to repeat instructions, all programming languages provide repetition structures.
True
2
The Loop instruction can use only integers, or whole numbers, as the number of times to repeat.
True
3
The following loop would execute ___________________ times:
Loop index from 0 up to (but not including) 10 times incrementing by 1
Loop index from 0 up to (but not including) 10 times incrementing by 1
10
4
Which of the following is an example of an infinite loop?
A) While 1 > 2
B) While 2 < 1
C) While 1 == 1
D) Loop 1000 times times
E) None of these
A) While 1 > 2
B) While 2 < 1
C) While 1 == 1
D) Loop 1000 times times
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
5
The While instruction can be used to test the value of an object's property.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
6
The following loop would execute how many times? Loop index from 0 up to (but not including) 3 times incrementing by 1
A) 1
B) 2
C) 3
D) 4
E) None of these
A) 1
B) 2
C) 3
D) 4
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
7
Which type of structure is used to execute the same set instructions more than once?
A) Decision structure
B) Sequence structure
C) Repetition structure
D) Do together structure
E) None of these
A) Decision structure
B) Sequence structure
C) Repetition structure
D) Do together structure
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
8
A(n) ___________________ loop will repeat an unlimited number of times.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
9
The While instruction is a posttest loop.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
10
Because the condition is tested before the loop is repeated, what is another term for the While instruction?
A) Counter-controlled loop
B) Infinite loop
C) Posttest loop
D) Pretest loop
E) None of these
A) Counter-controlled loop
B) Infinite loop
C) Posttest loop
D) Pretest loop
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
11
The ___________________ instruction causes a set of instructions to execute as long as a specified Boolean expression is true.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
12
This is the type of variable that the Loop instruction uses internally.
A) Register
B) Counter
C) Matrix
D) Address
E) None of these
A) Register
B) Counter
C) Matrix
D) Address
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
13
Which type of instruction will cause a set of instructions to execute as long as a specified Boolean expression is true?
A) If/Else
B) Loop
C) Repeat
D) While
E) None of these
A) If/Else
B) Loop
C) Repeat
D) While
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
14
The While instruction is also called a(n) ___________________ loop because the condition is tested before the loop is repeated.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
15
The Loop instruction causes a set of instructions to execute as long as a specified Boolean expression is true.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
16
The following loop would execute how many times? Loop 1 times times
A) 1
B) 2
C) 3
D) 4
E) None of these
A) 1
B) 2
C) 3
D) 4
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
17
You can use a variable or a function call to specify the number of repetitions that a loop will perform.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
18
The complicated version of the loop instruction shows that the loop uses a counter variable named ___________________.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
19
The following loop would execute how many times? Loop index from 0 up to (but not including) 4 times incrementing by 2
A) 1
B) 2
C) 3
D) 4
E) None of these
A) 1
B) 2
C) 3
D) 4
E) None of these
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
20
The ___________________ instruction causes a set of instructions to execute a certain number of times.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck