CSE 100 Exam 3 ACTUAL UPDATED QUESTIONS AND CORRECT ANSWERS
Unlike regular variables, arrays can hold multiple C
A) data types.
B) named constants.
C) values.
D) variables.
E) operators.
True/False: The amount of memory used by an array False
depends solely on the number of elements the array can
hold.
To access an array element, use the array name and the D
element's
A) name.
B) data type.
C) value.
D) subscript.
E) size declarator.
True/False: If a C++ program contains the following array False
definition
int score[10];
the following statement would store 100 in the first array
element:
score[1] = 100;
The statement E
int grades[ ] = { 100, 90, 99, 80 };
is an example of
A) default arguments.
B) an illegal array declaration.
C) an illegal array initialization.
D) data encapsulation.
E) implicit array sizing.
Which of the following statements correctly initialize the D
value variable?
A) int value = 8;
B) int value{8};
C) int value(8);
D) All of the above.
E) Both A and B, but not C.
, Which of the following statements will correctly carry out D
the operation stated in the comment to its right.
A) array 2 = array1 // Copy the elements of array 1 into
array 2.
B) cout << array2 // Output the elements stored in array 2.
C) array2 = 5; // Place a 5 in each element of array2.
D) None of the above.
E) A and B, but not C.
By using the same ________ you can build relationships C
between data stored in two or more arrays.
A) array name
B) data
C) subscript
D) arguments
E) data type
To step through a one-dimensional array, accessing the C
elements one by one, it would be most appropriate to
use _____ loop.
A) an infinite
B) a sentinel controlled loop
C) a for loop
D) a nested loop
E) no
True/False: Arrays can be passed to functions, but False
individual array elements cannot be.
When an array is passed to a function, it is actually ________ A
the array that is passed.
A) the starting memory address of
B) a copy of all the values in
C) the value stored in the first element of
D) the data type and size of
E) the data type and name of
True/False: When you pass an array as an argument to a True
function, the function can modify the contents of the
array.
A two-dimensional array can be viewed as C
A) two rows of values.
B) two columns of indexes.
C) a table with rows and columns.
D) any of the above.
E) none of the above.
Unlike regular variables, arrays can hold multiple C
A) data types.
B) named constants.
C) values.
D) variables.
E) operators.
True/False: The amount of memory used by an array False
depends solely on the number of elements the array can
hold.
To access an array element, use the array name and the D
element's
A) name.
B) data type.
C) value.
D) subscript.
E) size declarator.
True/False: If a C++ program contains the following array False
definition
int score[10];
the following statement would store 100 in the first array
element:
score[1] = 100;
The statement E
int grades[ ] = { 100, 90, 99, 80 };
is an example of
A) default arguments.
B) an illegal array declaration.
C) an illegal array initialization.
D) data encapsulation.
E) implicit array sizing.
Which of the following statements correctly initialize the D
value variable?
A) int value = 8;
B) int value{8};
C) int value(8);
D) All of the above.
E) Both A and B, but not C.
, Which of the following statements will correctly carry out D
the operation stated in the comment to its right.
A) array 2 = array1 // Copy the elements of array 1 into
array 2.
B) cout << array2 // Output the elements stored in array 2.
C) array2 = 5; // Place a 5 in each element of array2.
D) None of the above.
E) A and B, but not C.
By using the same ________ you can build relationships C
between data stored in two or more arrays.
A) array name
B) data
C) subscript
D) arguments
E) data type
To step through a one-dimensional array, accessing the C
elements one by one, it would be most appropriate to
use _____ loop.
A) an infinite
B) a sentinel controlled loop
C) a for loop
D) a nested loop
E) no
True/False: Arrays can be passed to functions, but False
individual array elements cannot be.
When an array is passed to a function, it is actually ________ A
the array that is passed.
A) the starting memory address of
B) a copy of all the values in
C) the value stored in the first element of
D) the data type and size of
E) the data type and name of
True/False: When you pass an array as an argument to a True
function, the function can modify the contents of the
array.
A two-dimensional array can be viewed as C
A) two rows of values.
B) two columns of indexes.
C) a table with rows and columns.
D) any of the above.
E) none of the above.