A) The last element of an array has position number one less than the array size.
B) The position number contained within square brackets is called a subscript.
C) A subscript cannot be an expression.
D) All of the above.
Correct Answer
verified
Multiple Choice
A) array<int, 5> n{0, 7, 0, 3, 8};
B) array<int, 5> n{0, 7, 0, 3, 8, 2};
C) array<int, 5> n{7};
D) array<int, 5> n{9, 1, 9};
Correct Answer
verified
Multiple Choice
A) catch block
B) try statement.
C) throw block.
D) what statement.
Correct Answer
verified
Multiple Choice
A) Can result in changes to the value of an unrelated variable.
B) Is impossible because C++ checks to make sure it does not happen.
C) Is a syntax error.
D) Enlarges the size of the array.
Correct Answer
verified
Multiple Choice
A) Can be assigned values in executable statements.
B) Do not have to be initialized when they are declared.
C) Can be used to specify array sizes, thereby making programs more scalable.
D) Can be used to specify array sizes, but this makes programs harder to understand.
Correct Answer
verified
Multiple Choice
A) for (int i = 0; i <items.size() ; ++i) { cout <
B) for (int item : items) { cout <
C) for (int item : items) { cout <
D) for (int item : items.size() ) { cout <
Correct Answer
verified
Multiple Choice
A) Average.
B) Minimum.
C) Maximum.
D) Distribution.
Correct Answer
verified
Multiple Choice
A) sort function.
B) sort_array function.
C) array_sort function.
D) None of the above.
Correct Answer
verified
Multiple Choice
A) The size of a vector can be changed after it is declared.
B) A vector can be assigned to another vector by using the assignment operator.
C) A vector object can be initialized with a copy of another vector by invoking the copy constructor.
D) A vector can store only data of type int.
Correct Answer
verified
Multiple Choice
A) A consecutive group of memory locations.
B) Subscripted by integers.
C) Made up of different data types.
D) None of the above.
Correct Answer
verified
Multiple Choice
A) 15
B) 13
C) 10
D) 8
Correct Answer
verified
Multiple Choice
A) The outer for loop initializes its counter variable.
B) The outer for loop increments its counter variable.
C) The inner for loop initializes its counter variable.
D) The inner for loop increments its counter variable.
Correct Answer
verified
Multiple Choice
A) Calculating the product of all the values in an array.
B) Displaying all even element values in an array.
C) Incrementing the value stored in each element of the array.
D) Accessing the element's subscript.
Correct Answer
verified
Multiple Choice
A) Does not, does not.
B) Does not, does.
C) Does, does not.
D) Does, does.
Correct Answer
verified
Multiple Choice
A) Unsorted arrays.
B) Sorted arrays.
C) Integer arrays.
D) Any of the above.
Correct Answer
verified
Multiple Choice
A) array<array<int,2>, 2> b; b[0][0] = b[0][1] = b[1][0] = b[1][1] = 0;
B) array<array<int, 2>, 2> b = {0};
C) array<array<int, 2>, 2> b; for (auto const &row : b) {
For (auto &element : row) {
Element = 0;
}
}
D) All of the above initialize all four of the array elements to 0.
Correct Answer
verified
Multiple Choice
A) array c<12>;
B) array c<int, 12>;
C) array<12> c;
D) array<int, 12> c;
Correct Answer
verified
Multiple Choice
A) Call the exception object's what member function to get the error message that's stored in the exception object.
B) Bounds checking is performed at execution time with vector member function at, and if a subscript is within the bounds of the array, the member function throws an out_of_bounds exception.
C) The catch block contains the code that handles an exception if one occurs.
D) None of the above statements in false.
Correct Answer
verified
Showing 1 - 18 of 18
Related Exams