Deck 13: Array Applications

Full screen (f)
exit full mode
Question
The condition IF A = 5 AND B > 10 will be true if

A)A = 5 is true
B)B > 10 is true
C)both A = 5 and B > 10 are true
D)all of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
Arranging the values in a table in a certain sequence is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
Question
Reading a table into computer storage is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
Question
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=5Y=7\begin{array} { l } \mathrm { X } = 5 \\\mathrm { Y } = 7\end{array}
IF INT(5.4)=X\operatorname { INT } ( 5.4 ) = \mathrm { X } AND INT(6.9) =Y= \mathrm { Y } THEN X=X+Y\mathrm { X } = \mathrm { X } + \mathrm { Y }
ELSE
Y=Y+1\mathrm { Y } = \mathrm { Y } + 1
ENDIF

A)5
B)7
C)8
D)12
Question
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=5Y=7 IF INT(5.4)=XORINT(7.0)=Y THEN X=X+Y ELSE Y=Y+1\begin{array} { l } \mathrm { X } = 5 \\\mathrm { Y } = 7 \\\text { IF } \operatorname { INT } ( 5.4 ) = \mathrm { X } \mathrm { OR } \mathrm { INT } ( 7.0 ) = \mathrm { Y } \text { THEN } \\\mathrm { X } = \mathrm { X } + \mathrm { Y } \\\text { ELSE } \\\mathrm { Y } = \mathrm { Y } + 1 \\\end{array}
ENDIF

A)5
B)7
C)8
D)12
Question
Looking up values in a table is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
Question
In a binary search,the search begins with an entry at the beginning of the table.
Question
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=6Y=7\begin{array} { l } X = 6 \\Y = 7\end{array}
IFINT(5.5)=X\operatorname { IF } \operatorname { INT } ( 5.5 ) = \mathrm { X } OR INT(6.9)=Y\operatorname { INT } ( 6.9 ) = \mathrm { Y } THEN
X=X+Y\mathrm { X } = \mathrm { X } + \mathrm { Y }
ELSE
Y=Y+1Y = Y + 1
ENDIF

A)6
B)7
C)8
D)13
Question
What is the value of COUNT after the steps in the following pseudocode are executed?
 COUNT =0 TOTAL =5 PASS =4 DOWHILE PASS < TOTAL  NEXT = PASS +1 DOWHILE NEXT  TOTAL  COUNT = COUNT +1 NEXT = NEXT +1 ENDDO  PASS = PASS +1\begin{array} { l } \text { COUNT } = 0 \\\text { TOTAL } = 5 \\\text { PASS } = 4 \\\text { DOWHILE PASS } < \text { TOTAL } \\\quad \text { NEXT } = \text { PASS } + 1 \\\text { DOWHILE NEXT } \leq \text { TOTAL } \\\quad \text { COUNT } = \text { COUNT } + 1 \\\quad \text { NEXT } = \text { NEXT } + 1 \\\text { ENDDO } \\\text { PASS } = \text { PASS } + 1\end{array}
ENDDO

A)4
B)5
C)10
D)none of the above
Question
A binary search should be considered when

A)the frequency of use of table entries is evenly distributed
B)the number of entries in the table is very large
C)processing efficiency is mandatory
D)all of the above
Question
The condition IF A = 5 OR B > 10 will be true if

A)A = 5 is true
B)B > 10 is true
C)both A = 5 and B > 10 are true
D)all of the above
Question
What is the value of X if X = INT(3.4)+ INT(7.9)?

A)10
B)11
C)11.3
D)12
Question
The result of an AND operation will be true if all of the conditions are met.
Question
The keywords AND and OR are examples of

A)program switches
B)string variables
C)Boolean operators
D)key fields
Question
What is the maximum number of comparisons that would be needed to determine whether or not a match is found in a sequential search of 64 elements?

A)6
B)7
C)63
D)64
Question
A program switch must always contain one of two values - 0 or 1.
Question
What is the name of the field that is in either ascending or descending order and will be searched when a table-lookup is performed?

A)program switch
B)key field
C)search key
D)both b and c
Question
What is the maximum number of comparisons that would be needed to determine whether or not a match is found in a binary search of 64 elements?

A)6
B)7
C)63
D)64
Question
In a binary search,the entries in the table being searched must be in either ascending or descending sequence.
Question
The result of an OR operation will be true if one but not both of the conditions are met.
Question
If X = INT(6.5)then the value of X is 7.
Question
The name of the field that is in either ascending or descending order and will be searched when a table-lookup is performed is called the search key.
Question
A sequential search is more efficient than a binary search.
Question
The binary search technique is particularly valuable when a table contains only a few entries.
Question
A sequence check must always be performed on data that will be searched.
Question
A program switch can be used as a loop control variable.
Question
Loading a table is usually done in the initialization portion of a program.
Question
After the first pass of a descending sort operation is completed,the last value in the group is definitely known to contain the smallest value.
Question
After the first pass of an ascending sort operation is completed,the first value in the group is definitely known to contain the smallest value.
Question
In a binary search when the lower bound is found to be greater than the upper bound,we know that the value being searched for has been found.
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 13: Array Applications
1
The condition IF A = 5 AND B > 10 will be true if

A)A = 5 is true
B)B > 10 is true
C)both A = 5 and B > 10 are true
D)all of the above
C
2
Arranging the values in a table in a certain sequence is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
B
3
Reading a table into computer storage is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
A
4
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=5Y=7\begin{array} { l } \mathrm { X } = 5 \\\mathrm { Y } = 7\end{array}
IF INT(5.4)=X\operatorname { INT } ( 5.4 ) = \mathrm { X } AND INT(6.9) =Y= \mathrm { Y } THEN X=X+Y\mathrm { X } = \mathrm { X } + \mathrm { Y }
ELSE
Y=Y+1\mathrm { Y } = \mathrm { Y } + 1
ENDIF

A)5
B)7
C)8
D)12
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=5Y=7 IF INT(5.4)=XORINT(7.0)=Y THEN X=X+Y ELSE Y=Y+1\begin{array} { l } \mathrm { X } = 5 \\\mathrm { Y } = 7 \\\text { IF } \operatorname { INT } ( 5.4 ) = \mathrm { X } \mathrm { OR } \mathrm { INT } ( 7.0 ) = \mathrm { Y } \text { THEN } \\\mathrm { X } = \mathrm { X } + \mathrm { Y } \\\text { ELSE } \\\mathrm { Y } = \mathrm { Y } + 1 \\\end{array}
ENDIF

A)5
B)7
C)8
D)12
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
Looking up values in a table is often referred to as

A)loading a table
B)sorting a table
C)searching a table
D)defining a table
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
In a binary search,the search begins with an entry at the beginning of the table.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
What is the value of X after the instructions corresponding to the following pseudocode are executed?
X=6Y=7\begin{array} { l } X = 6 \\Y = 7\end{array}
IFINT(5.5)=X\operatorname { IF } \operatorname { INT } ( 5.5 ) = \mathrm { X } OR INT(6.9)=Y\operatorname { INT } ( 6.9 ) = \mathrm { Y } THEN
X=X+Y\mathrm { X } = \mathrm { X } + \mathrm { Y }
ELSE
Y=Y+1Y = Y + 1
ENDIF

A)6
B)7
C)8
D)13
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
What is the value of COUNT after the steps in the following pseudocode are executed?
 COUNT =0 TOTAL =5 PASS =4 DOWHILE PASS < TOTAL  NEXT = PASS +1 DOWHILE NEXT  TOTAL  COUNT = COUNT +1 NEXT = NEXT +1 ENDDO  PASS = PASS +1\begin{array} { l } \text { COUNT } = 0 \\\text { TOTAL } = 5 \\\text { PASS } = 4 \\\text { DOWHILE PASS } < \text { TOTAL } \\\quad \text { NEXT } = \text { PASS } + 1 \\\text { DOWHILE NEXT } \leq \text { TOTAL } \\\quad \text { COUNT } = \text { COUNT } + 1 \\\quad \text { NEXT } = \text { NEXT } + 1 \\\text { ENDDO } \\\text { PASS } = \text { PASS } + 1\end{array}
ENDDO

A)4
B)5
C)10
D)none of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
A binary search should be considered when

A)the frequency of use of table entries is evenly distributed
B)the number of entries in the table is very large
C)processing efficiency is mandatory
D)all of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
The condition IF A = 5 OR B > 10 will be true if

A)A = 5 is true
B)B > 10 is true
C)both A = 5 and B > 10 are true
D)all of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
What is the value of X if X = INT(3.4)+ INT(7.9)?

A)10
B)11
C)11.3
D)12
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
The result of an AND operation will be true if all of the conditions are met.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
The keywords AND and OR are examples of

A)program switches
B)string variables
C)Boolean operators
D)key fields
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
What is the maximum number of comparisons that would be needed to determine whether or not a match is found in a sequential search of 64 elements?

A)6
B)7
C)63
D)64
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
A program switch must always contain one of two values - 0 or 1.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
What is the name of the field that is in either ascending or descending order and will be searched when a table-lookup is performed?

A)program switch
B)key field
C)search key
D)both b and c
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
What is the maximum number of comparisons that would be needed to determine whether or not a match is found in a binary search of 64 elements?

A)6
B)7
C)63
D)64
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
In a binary search,the entries in the table being searched must be in either ascending or descending sequence.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
The result of an OR operation will be true if one but not both of the conditions are met.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
If X = INT(6.5)then the value of X is 7.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
The name of the field that is in either ascending or descending order and will be searched when a table-lookup is performed is called the search key.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
A sequential search is more efficient than a binary search.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
The binary search technique is particularly valuable when a table contains only a few entries.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
A sequence check must always be performed on data that will be searched.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
A program switch can be used as a loop control variable.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
Loading a table is usually done in the initialization portion of a program.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
After the first pass of a descending sort operation is completed,the last value in the group is definitely known to contain the smallest value.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
After the first pass of an ascending sort operation is completed,the first value in the group is definitely known to contain the smallest value.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
In a binary search when the lower bound is found to be greater than the upper bound,we know that the value being searched for has been found.
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.