Deck 5: Repetition Structures

Full screen (f)
exit full mode
Question
Because programmers commonly need to repeat instructions, all programming languages provide repetition structures.
Use Space or
up arrow
down arrow
to flip the card.
Question
The Loop instruction can use only integers, or whole numbers, as the number of times to repeat.
Question
The following loop would execute ___________________ times:
Loop index from 0 up to (but not including) 10 times incrementing by 1
Question
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
Question
The While instruction can be used to test the value of an object's property.
Question
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
Question
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
Question
A(n) ___________________ loop will repeat an unlimited number of times.
Question
The While instruction is a posttest loop.
Question
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
Question
The ___________________ instruction causes a set of instructions to execute as long as a specified Boolean expression is true.
Question
This is the type of variable that the Loop instruction uses internally.

A) Register
B) Counter
C) Matrix
D) Address
E) None of these
Question
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
Question
The While instruction is also called a(n) ___________________ loop because the condition is tested before the loop is repeated.
Question
The Loop instruction causes a set of instructions to execute as long as a specified Boolean expression is true.
Question
The following loop would execute how many times? Loop 1 times times

A) 1
B) 2
C) 3
D) 4
E) None of these
Question
You can use a variable or a function call to specify the number of repetitions that a loop will perform.
Question
The complicated version of the loop instruction shows that the loop uses a counter variable named ___________________.
Question
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
Question
The ___________________ instruction causes a set of instructions to execute a certain number of times.
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 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
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
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
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
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
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
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
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
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
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
locked card icon
Unlock Deck
Unlock for access to all 20 flashcards in this deck.