QUESTION 1 Assume that the following statements have been executed: vector a, b(
ID: 3717710 • Letter: Q
Question
QUESTION 1
Assume that the following statements have been executed:
vector a, b(5), c(5, 1), d(5);
d.push_back(77);
d.push_back(88);
The capacity of c is and its size is .
QUESTION 2
Assume that the following statements have been executed:
vector a, b(5), c(5, 1), d(5);
d.push_back(77);
d.push_back(88);
The capacity of a is and its size is .
QUESTION 3
Assume that the following statements have been executed:
vector a, b(5), c(5, 1), d(5);
d.push_back(77);
d.push_back(88);
The output of the following for loop:
for (int j = 0; j < c.size(); j++)
cout << c[ j ] << ' ';
is: __________________________
QUESTION 4
Vectors are declared as such
vector size(name)
vector name(size)
vector size(type)
vector type(size)
None of the above.
QUESTION 5
Assume that the following statements have been executed:
vector a, b(5), c(5, 1), d(5);
d.push_back(77);
d.push_back(88);
then:
d.end() returns an iterator positioned ___________ in d.
A.vector size(name)
B.vector name(size)
C.vector size(type)
D.vector type(size)
E.None of the above.
Explanation / Answer
1. The capacity of c is 5 and its size is 5;
2. The capacity of a is 0 and its size is 0;
3.The output of the following for loop:
1 1 1 1 1
4. B.vector name(size)
5. d.end() returns an iterator positioned last in d.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.