Deck 5: Dowhile Control Structuretrailer Record Logic

Full screen (f)
exit full mode
Question
A variable whose value does not change during program execution is called a

A)constant
B)named constant
C)static variable
D)initialized variable
Use Space or
up arrow
down arrow
to flip the card.
Question
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Question
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 0,6,7,3,0 - are input,one on each record?
DOWHILE SCORE >0> 0
Read SCORE Write SCORE
ENDDO

A)0
B)5
C)unknown
D)infinite
Question
What type of line is placed within the loop and outputs information about an individual record?

A)heading
B)detail
C)total
D)both b and c
Question
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 Read VALUE  DOWHILE VALUE >0 Write Value  SUM = SUM + VALUE  COUNT = COUNT +1 Read VALUE  ENDDO  Write SUM, COUNT \begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { Read VALUE } \\\text { DOWHILE VALUE } > 0 \\\text { Write Value } \\\quad \text { SUM } = \text { SUM } + \text { VALUE } \\\quad \text { COUNT } = \text { COUNT } + 1 \\\quad \text { Read VALUE } \\\text { ENDDO } \\\text { Write SUM, COUNT }\end{array}

A)4
B)5
C)6
D)7
Question
In trailer record logic a counter is used to control the loop.
Question
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Read SCORE
Write SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Question
A trailer record is also called a(n)

A)constant data value
B)sentinel value
C)9s record
D)EOF record
Question
The loop read is always executed more than one time.
Question
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 DOWHILE VALUE >0 Read VALUE  Write Value  SUM = SUM + VALUE  COUNT = COUNT +1\begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { DOWHILE VALUE } > 0 \\\text { Read VALUE } \\\text { Write Value } \\\text { SUM } = \text { SUM } + \text { VALUE } \\\text { COUNT } = \text { COUNT } + 1\end{array}
ENDDO
Write SUM, COUNT

A)4
B)5
C)6
D)7
Question
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 DOWHILE VALUE >0 Write Value  SUM = SUM + VALUE  COUNT = COUNT +1 Read VALUE  ENDDO  Write SUM, COUNT \begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { DOWHILE VALUE } > 0 \\\text { Write Value } \\\quad \text { SUM } = \text { SUM } + \text { VALUE } \\\text { COUNT } = \text { COUNT } + 1 \\\text { Read VALUE } \\\text { ENDDO } \\\text { Write SUM, COUNT }\end{array}

A)4
B)5
C)6
D)7
Question
A total line is a line of output associated with one input record.
Question
The empty file condition can occur in both header record logic and trailer record logic.
Question
The priming read is placed

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Question
The loop read in a loop controlled using trailer record logic is placed

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Question
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 0,8,6,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
Read SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Question
What statement(s)are unnecessary in the following pseudocode?
COUNT=0\mathrm { COUNT } = 0
SUM =0= 0
Read VALUE
DOWHILE VALUE >0> 0
SUM == SUM + VALUE
COUNT == COUNT + 1
Read VALUE
ENDDO
Write SUM

A)COUNT = 0 and COUNT = COUNT + 1
B)SUM = 0 and SUM = SUM + VALUE
C)The first Read VALUE
D)The second Read VALUE
Question
Where is the write statement for a total line generally placed?

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Question
The automatic end-of-file facility is implemented differently in different programming languages.
Question
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
Read SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Question
If you are using the automatic end-of-file facility,you need to include a special record at the end of the input denoting that there is no more data to process.
Question
Line count and page count are special types of trailer records.
Question
The priming read is usually placed as the first step within the loop.
Question
A line that outputs the average grade for each student can be considered in some cases,both a detail line and a total line.
Question
A detail line is usually written after the loop is exited.
Question
In trailer record logic the number of times the loop will be executed is preset.
Question
The loop read in a loop controlled using trailer record logic is usually placed as the last step in the loop.
Question
A heading line serves as a title to a report that is output.
Question
The use of named constants makes an algorithm more flexible.
Question
A trailer record must contain special information that differentiates it from the rest of the input.
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 5: Dowhile Control Structuretrailer Record Logic
1
A variable whose value does not change during program execution is called a

A)constant
B)named constant
C)static variable
D)initialized variable
B
2
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
ENDDO

A)0
B)4
C)5
D)infinite
infinite
3
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 0,6,7,3,0 - are input,one on each record?
DOWHILE SCORE >0> 0
Read SCORE Write SCORE
ENDDO

A)0
B)5
C)unknown
D)infinite
unknown
4
What type of line is placed within the loop and outputs information about an individual record?

A)heading
B)detail
C)total
D)both b and c
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 Read VALUE  DOWHILE VALUE >0 Write Value  SUM = SUM + VALUE  COUNT = COUNT +1 Read VALUE  ENDDO  Write SUM, COUNT \begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { Read VALUE } \\\text { DOWHILE VALUE } > 0 \\\text { Write Value } \\\quad \text { SUM } = \text { SUM } + \text { VALUE } \\\quad \text { COUNT } = \text { COUNT } + 1 \\\quad \text { Read VALUE } \\\text { ENDDO } \\\text { Write SUM, COUNT }\end{array}

A)4
B)5
C)6
D)7
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
In trailer record logic a counter is used to control the loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Read SCORE
Write SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
A trailer record is also called a(n)

A)constant data value
B)sentinel value
C)9s record
D)EOF record
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
The loop read is always executed more than one time.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 DOWHILE VALUE >0 Read VALUE  Write Value  SUM = SUM + VALUE  COUNT = COUNT +1\begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { DOWHILE VALUE } > 0 \\\text { Read VALUE } \\\text { Write Value } \\\text { SUM } = \text { SUM } + \text { VALUE } \\\text { COUNT } = \text { COUNT } + 1\end{array}
ENDDO
Write SUM, COUNT

A)4
B)5
C)6
D)7
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
What value of COUNT will be output after the instructions corresponding to the following pseudocode are executed,assuming 7 values - 5,6,7,3,0,4,2 - are input,one on each record?
 COUNT =0 SUM =0 VALUE =1 DOWHILE VALUE >0 Write Value  SUM = SUM + VALUE  COUNT = COUNT +1 Read VALUE  ENDDO  Write SUM, COUNT \begin{array} { l } \text { COUNT } = 0 \\\text { SUM } = 0 \\\text { VALUE } = 1 \\\text { DOWHILE VALUE } > 0 \\\text { Write Value } \\\quad \text { SUM } = \text { SUM } + \text { VALUE } \\\text { COUNT } = \text { COUNT } + 1 \\\text { Read VALUE } \\\text { ENDDO } \\\text { Write SUM, COUNT }\end{array}

A)4
B)5
C)6
D)7
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
A total line is a line of output associated with one input record.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
The empty file condition can occur in both header record logic and trailer record logic.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
The priming read is placed

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
The loop read in a loop controlled using trailer record logic is placed

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 0,8,6,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
Read SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
What statement(s)are unnecessary in the following pseudocode?
COUNT=0\mathrm { COUNT } = 0
SUM =0= 0
Read VALUE
DOWHILE VALUE >0> 0
SUM == SUM + VALUE
COUNT == COUNT + 1
Read VALUE
ENDDO
Write SUM

A)COUNT = 0 and COUNT = COUNT + 1
B)SUM = 0 and SUM = SUM + VALUE
C)The first Read VALUE
D)The second Read VALUE
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
Where is the write statement for a total line generally placed?

A)before the loop
B)within the loop as the first statement
C)within the loop as the last statement
D)after the loop
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
The automatic end-of-file facility is implemented differently in different programming languages.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
How many times will the loop steps in the instructions corresponding to the following pseudocode be executed,assuming 5 values - 5,6,7,3,0 - are input,one on each record?
Read SCORE
DOWHILE SCORE >0> 0
Write SCORE
Read SCORE
ENDDO

A)0
B)4
C)5
D)infinite
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
If you are using the automatic end-of-file facility,you need to include a special record at the end of the input denoting that there is no more data to process.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
Line count and page count are special types of trailer records.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
The priming read is usually placed as the first step within the loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
A line that outputs the average grade for each student can be considered in some cases,both a detail line and a total line.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
A detail line is usually written after the loop is exited.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
In trailer record logic the number of times the loop will be executed is preset.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
The loop read in a loop controlled using trailer record logic is usually placed as the last step in the loop.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
A heading line serves as a title to a report that is output.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
The use of named constants makes an algorithm more flexible.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
A trailer record must contain special information that differentiates it from the rest of the input.
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.