Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote