Deck 4: Dowhile Control Structurecounter-Controlled Loops

Full screen (f)
exit full mode
Question
To create a properly formed DOWHILE loop you must

A)place the loop test before any other step in the loop
B)place the loop steps in the NO path of the loop test
C)indicate that the loop will exit in the YES path of the loop test
D)all of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
A counter-controlled loop is more flexible than a loop controlled by a header record value.
Question
A program that can be viewed as a single statement is called a

A)structured program
B)proper program
C)header record logic program
D)SIMPLE SEQUENCE program
Question
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT \leq START
COUNT == COUNT - 1
Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Question
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT >> START
COUNT == COUNT - 1
Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Question
Which program flowcharting symbol can be used to represent an initialization step in a program flowchart?

A)decision
B)connector
C)terminal interrupt
D)preparation
Question
The test for the No-Data condition is implemented in program design with a(n)

A)IFTHENELSE pattern
B)DOWHILE loop
C)READ statement
D)preparation step
Question
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
 COUNT =5 SUM =100 DOWHILE COUNT >5 SUM = SUM +5 COUNT = COUNT +1 ENDDO  ANSWER = SUM \begin{array} { l } \text { COUNT } = 5 \\\text { SUM } = 100 \\\text { DOWHILE COUNT } > 5 \\\quad \text { SUM } = \text { SUM } + 5 \\\quad \text { COUNT } = \text { COUNT } + 1 \\\text { ENDDO } \\\text { ANSWER } = \text { SUM }\end{array}

A)100
B)125
C)5
D)25
Question
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
COUNT=2\mathrm { COUNT } = 2
SUM=100\mathrm { SUM } = 100
DOWHILE COUNT <5< 5
SUM=SUM+5\mathrm { SUM } = \mathrm { SUM } + 5
COUNT=COUNT+1\mathrm { COUNT } = \mathrm { COUNT } + 1
ENDDO
ANSWER == SUM

A)110
B)115
C)120
D)125
Question
A partial sum cannot have the same value as the corresponding total sum.
Question
A variable that is used to hold the sum of a group of values is called a(n)

A)counter
B)accumulator
C)header record
D)loop control
Question
How many values will be output when the instructions corresponding to the following pseudocode are executed?
ACCUM=1\mathrm { ACCUM } = 1
COUNT =0= 0
DOWHILE COUNT <4< 4
ACCUM=ACCUM+ACCUMA C C U M = A C C U M + A C C U M
COUNT == COUNT + 1
Write ACCUM
ENDDO\mathrm { ENDDO }
Write ACCUM

A)4
B)5
C)8
D)16
Question
What type of loop is executed a predetermined number of times?

A)infinite
B)counter-controlled
C)header record
D)leading decision
Question
A sequence of processing steps that must be repeated is called a

A)decision
B)counter
C)loop
D)proper program
Question
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
 COUNT =1 SUM =3 DOWHILE COUNT 0 SUM = SUM + COUNT  COUNT = COUNT 1 ENDDO  ANSWER = SUM \begin{array} { l } \text { COUNT } = 1 \\\text { SUM } = 3 \\\text { DOWHILE COUNT } \geq 0 \\\quad \text { SUM } = \text { SUM } + \text { COUNT } \\\quad \text { COUNT } = \text { COUNT } - 1 \\\text { ENDDO } \\\text { ANSWER } = \text { SUM }\end{array}

A)3
B)4
C)5
D)6
Question
A DOWHILE loop is a leading-decision program loop.
Question
Any solution algorithm can be expressed using one or more of the three basic control structures.
Question
An accumulator always adds or accumulates by a constant amount.
Question
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT \geq START COUNT == COUNT - 1 Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Question
What is the value of the variable ACCUM after the instructions corresponding to the following pseudocode are executed?
ACCUM=1\mathrm { ACCUM } = 1
COUNT =0= 0
DOWHILE COUNT4C O U N T \leq 4
ACCUM=ACCUM+ACCUM\mathrm { ACCUM } = \mathrm { ACCUM } + \mathrm { ACCUM }
COUNT=COUNT+1\mathrm { COUNT } = \mathrm { COUNT } + 1
ENDDO

A)8
B)16
C)32
D)64
Question
The steps after the loop are always placed on the line after ENDDO and are indented a few positions for clarity.
Question
In a counter-controlled loop,the value of the counter must be changed by some statement within the loop..
Question
To create a properly formed DOWHILE loop you must place the loop steps in the YES path of the loop.
Question
A preparation symbol should be used in a program flowchart to initialize a counter prior to entering a loop.
Question
A counter used to control a loop can be either incremented or decremented.
Question
A connector symbol must be placed at the exit point of a DOWHILE loop just as it is placed at the exit point of an IFTHENELSE control structure.
Question
A READ statement used to input a header record must be placed within the loop that a value in the header record is controlling.
Question
To create a properly formed DOWHILE loop you must place the loop test after all other steps within the loop.
Question
The loop steps are placed between the DOWHILE statement and the ENDDO statement and are not indented.
Question
When header record logic is used in loop processing,the loop is controlled by a counter.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/30
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Dowhile Control Structurecounter-Controlled Loops
1
To create a properly formed DOWHILE loop you must

A)place the loop test before any other step in the loop
B)place the loop steps in the NO path of the loop test
C)indicate that the loop will exit in the YES path of the loop test
D)all of the above
A
2
A counter-controlled loop is more flexible than a loop controlled by a header record value.
False
3
A program that can be viewed as a single statement is called a

A)structured program
B)proper program
C)header record logic program
D)SIMPLE SEQUENCE program
B
4
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT \leq START
COUNT == COUNT - 1
Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT >> START
COUNT == COUNT - 1
Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
Which program flowcharting symbol can be used to represent an initialization step in a program flowchart?

A)decision
B)connector
C)terminal interrupt
D)preparation
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
The test for the No-Data condition is implemented in program design with a(n)

A)IFTHENELSE pattern
B)DOWHILE loop
C)READ statement
D)preparation step
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
 COUNT =5 SUM =100 DOWHILE COUNT >5 SUM = SUM +5 COUNT = COUNT +1 ENDDO  ANSWER = SUM \begin{array} { l } \text { COUNT } = 5 \\\text { SUM } = 100 \\\text { DOWHILE COUNT } > 5 \\\quad \text { SUM } = \text { SUM } + 5 \\\quad \text { COUNT } = \text { COUNT } + 1 \\\text { ENDDO } \\\text { ANSWER } = \text { SUM }\end{array}

A)100
B)125
C)5
D)25
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
COUNT=2\mathrm { COUNT } = 2
SUM=100\mathrm { SUM } = 100
DOWHILE COUNT <5< 5
SUM=SUM+5\mathrm { SUM } = \mathrm { SUM } + 5
COUNT=COUNT+1\mathrm { COUNT } = \mathrm { COUNT } + 1
ENDDO
ANSWER == SUM

A)110
B)115
C)120
D)125
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
A partial sum cannot have the same value as the corresponding total sum.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
A variable that is used to hold the sum of a group of values is called a(n)

A)counter
B)accumulator
C)header record
D)loop control
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
How many values will be output when the instructions corresponding to the following pseudocode are executed?
ACCUM=1\mathrm { ACCUM } = 1
COUNT =0= 0
DOWHILE COUNT <4< 4
ACCUM=ACCUM+ACCUMA C C U M = A C C U M + A C C U M
COUNT == COUNT + 1
Write ACCUM
ENDDO\mathrm { ENDDO }
Write ACCUM

A)4
B)5
C)8
D)16
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
What type of loop is executed a predetermined number of times?

A)infinite
B)counter-controlled
C)header record
D)leading decision
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
A sequence of processing steps that must be repeated is called a

A)decision
B)counter
C)loop
D)proper program
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
What is the value of ANSWER after the instructions corresponding to the following pseudocode are executed?
 COUNT =1 SUM =3 DOWHILE COUNT 0 SUM = SUM + COUNT  COUNT = COUNT 1 ENDDO  ANSWER = SUM \begin{array} { l } \text { COUNT } = 1 \\\text { SUM } = 3 \\\text { DOWHILE COUNT } \geq 0 \\\quad \text { SUM } = \text { SUM } + \text { COUNT } \\\quad \text { COUNT } = \text { COUNT } - 1 \\\text { ENDDO } \\\text { ANSWER } = \text { SUM }\end{array}

A)3
B)4
C)5
D)6
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
A DOWHILE loop is a leading-decision program loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
Any solution algorithm can be expressed using one or more of the three basic control structures.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
An accumulator always adds or accumulates by a constant amount.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
If the value input for START is 8,how many times will the instructions within the loop below be executed?
Read START
COUNT == START
DOWHILE COUNT \geq START COUNT == COUNT - 1 Write COUNT
ENDDO

A)0
B)1
C)8
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
What is the value of the variable ACCUM after the instructions corresponding to the following pseudocode are executed?
ACCUM=1\mathrm { ACCUM } = 1
COUNT =0= 0
DOWHILE COUNT4C O U N T \leq 4
ACCUM=ACCUM+ACCUM\mathrm { ACCUM } = \mathrm { ACCUM } + \mathrm { ACCUM }
COUNT=COUNT+1\mathrm { COUNT } = \mathrm { COUNT } + 1
ENDDO

A)8
B)16
C)32
D)64
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
The steps after the loop are always placed on the line after ENDDO and are indented a few positions for clarity.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
In a counter-controlled loop,the value of the counter must be changed by some statement within the loop..
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
To create a properly formed DOWHILE loop you must place the loop steps in the YES path of the loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
A preparation symbol should be used in a program flowchart to initialize a counter prior to entering a loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
A counter used to control a loop can be either incremented or decremented.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
A connector symbol must be placed at the exit point of a DOWHILE loop just as it is placed at the exit point of an IFTHENELSE control structure.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
A READ statement used to input a header record must be placed within the loop that a value in the header record is controlling.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
To create a properly formed DOWHILE loop you must place the loop test after all other steps within the loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
The loop steps are placed between the DOWHILE statement and the ENDDO statement and are not indented.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
When header record logic is used in loop processing,the loop is controlled by a counter.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 30 flashcards in this deck.