Deck 9: Introduction to Arrays

Full screen (f)
exit full mode
Question
What is the value of LIST(4)after the instructions corresponding to the following pseudocode are executed?
POS=1\operatorname { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \mathrm { POS } + 3
POS=POS+2\operatorname { POS } = \mathrm { POS } + 2
ENDDO

A)4
B)6
C)7
D)undefined
Use Space or
up arrow
down arrow
to flip the card.
Question
A single-level table is the same as a one-dimensional array.
Question
A dimension statement is used to define the

A)array name
B)minimum size of the array
C)maximum size of the array
D)both a and c
Question
What is the value of GRID(3,3)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)5
B)6
C)7
D)none of the above
Question
Using the term SCORE(I),which item below represents the array name?

A)SCORE
B)SCORE(I)
C)I
D)both a and b
Question
The DIM statement defines the maximum size of an array and is executed at the beginning of the program.
Question
A subscript can have more than one value at a time.
Question
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
What is the subscripted variable name that should be used to refer to the location containing Tuesday?

A)3
B)DAY(3)
C)DAY
D)both a and b
Question
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
Which item below can be used to refer to the location containing "Friday"?

A)6
B)DAY(6)
C)DAY
D)both a and b
Question
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
What is the content of DAY(7)?

A)7
B)"Saturday"
C)"Sunday"
D)none of the above
Question
Select the subscripted variable name that should be used to refer to the Mth position of the array named N.

A)N(M)
B)M(N)
C)M
D)N
Question
What is the value of POS after the instructions corresponding to the following pseudocode are executed?
POS=1\operatorname { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \operatorname { POS } + 3
POS=POS+2\mathrm { POS } = \mathrm { POS } + 2
ENDDO

A)9
B)10
C)11
D)12
Question
What is the value of LIST(5)after the instructions corresponding to the following pseudocode are executed?
POS=1\mathrm { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \operatorname { POS } + 3
POS=POS+2\mathrm { POS } = \mathrm { POS } + 2
ENDDO

A)5
B)7
C)8
D)undefined
Question
Using the term SCORE(I),which reference below represents the subscript?

A)SCORE
B)SCORE(I)
C)I
D)both b and c
Question
What is the value of GRID(5,4)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)7
B)8
C)9
D)undefined
Question
The position of an item in an array is specified using a

A)subscripted variable
B)vector
C)subscript
D)dimension statement
Question
An example of a simple variable is POS.
Question
A matrix is an example of a one-dimensional array.
Question
What is the value of GRID(3,1)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)4
B)5
C)6
D)undefined
Question
Using the term SCORE(I),which of the following items represents the subscripted variable name?

A)SCORE
B)SCORE(I)
C)I
D)both a and b
Question
In row-major order,the first subscript varies the most rapidly.
Question
Tables are not widely used in problem solving.
Question
Nested loops are often used in algorithms that process multi-dimensional arrays.
Question
In row-processing logic,all members of the first row of an array are accessed first.
Question
Most programming languages store and process data groups in column-major order.
Question
The Rth value in the one-dimensional array GRADE is referred to by GRADE(R).
Question
Given the term GRID(ROW,COLUMN),GRID is the array name.
Question
A variable name can be used as both a subscript and a counter in the same program.
Question
The number of elements in a two-dimensional array can be computed by adding the number of rows and the number of columns.
Question
Given the term MONTH(I),I is the subscripted variable name.
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 9: Introduction to Arrays
1
What is the value of LIST(4)after the instructions corresponding to the following pseudocode are executed?
POS=1\operatorname { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \mathrm { POS } + 3
POS=POS+2\operatorname { POS } = \mathrm { POS } + 2
ENDDO

A)4
B)6
C)7
D)undefined
undefined
2
A single-level table is the same as a one-dimensional array.
True
3
A dimension statement is used to define the

A)array name
B)minimum size of the array
C)maximum size of the array
D)both a and c
D
4
What is the value of GRID(3,3)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)5
B)6
C)7
D)none of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
Using the term SCORE(I),which item below represents the array name?

A)SCORE
B)SCORE(I)
C)I
D)both a and b
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
The DIM statement defines the maximum size of an array and is executed at the beginning of the program.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
A subscript can have more than one value at a time.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
What is the subscripted variable name that should be used to refer to the location containing Tuesday?

A)3
B)DAY(3)
C)DAY
D)both a and b
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
Which item below can be used to refer to the location containing "Friday"?

A)6
B)DAY(6)
C)DAY
D)both a and b
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
DAY is a seven-member one-dimensional array.Its contents are shown as follows:
 Surday  Monday  Tuesday  Wedrasday  Thursday  Friday  Saturday \begin{array}{l}\begin{array} { | l | } \hline\text { Surday }\\\hline \text { Monday } \\\hline \text { Tuesday } \\\hline \text { Wedrasday } \\\hline \text { Thursday } \\\hline \text { Friday } \\\hline \text { Saturday } \\\hline\end{array}\end{array}
What is the content of DAY(7)?

A)7
B)"Saturday"
C)"Sunday"
D)none of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
Select the subscripted variable name that should be used to refer to the Mth position of the array named N.

A)N(M)
B)M(N)
C)M
D)N
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
What is the value of POS after the instructions corresponding to the following pseudocode are executed?
POS=1\operatorname { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \operatorname { POS } + 3
POS=POS+2\mathrm { POS } = \mathrm { POS } + 2
ENDDO

A)9
B)10
C)11
D)12
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
What is the value of LIST(5)after the instructions corresponding to the following pseudocode are executed?
POS=1\mathrm { POS } = 1
DOWHILE POS <10< 10
LIST(POS)=POS+3\operatorname { LIST } ( \mathrm { POS } ) = \operatorname { POS } + 3
POS=POS+2\mathrm { POS } = \mathrm { POS } + 2
ENDDO

A)5
B)7
C)8
D)undefined
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
Using the term SCORE(I),which reference below represents the subscript?

A)SCORE
B)SCORE(I)
C)I
D)both b and c
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
What is the value of GRID(5,4)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)7
B)8
C)9
D)undefined
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
The position of an item in an array is specified using a

A)subscripted variable
B)vector
C)subscript
D)dimension statement
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
An example of a simple variable is POS.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
A matrix is an example of a one-dimensional array.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
What is the value of GRID(3,1)after the instructions corresponding to the following pseudocode are executed?
R = 1
DOWHILE R<5\mathrm { R } < 5
C = 2
DOWHILE C<5\mathrm { C } < 5
GRID R , C = R + C \\
C = C + 1
ENDDO
R = R + 2
ENDDO

A)4
B)5
C)6
D)undefined
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
Using the term SCORE(I),which of the following items represents the subscripted variable name?

A)SCORE
B)SCORE(I)
C)I
D)both a and b
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
In row-major order,the first subscript varies the most rapidly.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
Tables are not widely used in problem solving.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
Nested loops are often used in algorithms that process multi-dimensional arrays.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
In row-processing logic,all members of the first row of an array are accessed first.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
Most programming languages store and process data groups in column-major order.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
The Rth value in the one-dimensional array GRADE is referred to by GRADE(R).
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
Given the term GRID(ROW,COLUMN),GRID is the array name.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
A variable name can be used as both a subscript and a counter in the same program.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
The number of elements in a two-dimensional array can be computed by adding the number of rows and the number of columns.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
Given the term MONTH(I),I is the subscripted variable name.
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.