Deck 5: Dowhile Control Structuretrailer Record Logic
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
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/30
Play
Full screen (f)
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
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
Write SCORE
ENDDO
A)0
B)4
C)5
D)infinite
Read SCORE
DOWHILE SCORE
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
Read SCORE Write SCORE
ENDDO
A)0
B)5
C)unknown
D)infinite
DOWHILE SCORE
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
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?
A)4
B)5
C)6
D)7
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
Read SCORE
Write SCORE
ENDDO
A)0
B)4
C)5
D)infinite
Read SCORE
DOWHILE SCORE
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
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?
ENDDO
Write SUM, COUNT
A)4
B)5
C)6
D)7
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?
A)4
B)5
C)6
D)7
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
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
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
Write SCORE
Read SCORE
ENDDO
A)0
B)4
C)5
D)infinite
Read SCORE
DOWHILE SCORE
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?
SUM
Read VALUE
DOWHILE VALUE
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
SUM
Read VALUE
DOWHILE VALUE
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
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
Write SCORE
Read SCORE
ENDDO
A)0
B)4
C)5
D)infinite
Read SCORE
DOWHILE SCORE
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