Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, can someone help me with some c++ questions. 1. A vector is ________ 2. Which statement is most true about this declaration? vector vector1;

Hi, can someone help me with some c++ questions.

1.

A vector is ________

2.

Which statement is most true about this declaration?

vector vector1;

A.this declares a vector object that holds integer data

B.this declares a vector named double that holds integer data

C.this declares a vector object that holds double data

D.this declares an array that holds double data

3.

Objects are instances of classes that are used through calling methods.

A.True

B.False

4.What does the push_back() method do?

A.adds a value at the front of a vector

B.adds a value at the end of a vector

C.removes a value at the front of a vector

D.removes a value at the back of a vector

5.What method returns the number of items currently stored in a vector?

______________

6.

Which statement is true about this code:

vector names;

names[10] = "Tom";

A.it can be used to automatically set the capacity of the array to 11 items

B.it can be used anytime, regardless of the size of the array

C.it can't be used unless the capacity of the array has been previously set to 11

D.it should only be used if the size of the array is already at least 11

7.Which statement best describes the vector capacity() and size() methods?

A.they can be used interchangeably

B.capacity() returns the current potential number of storage positions and size() returns the actual number of things that are stored

C.size() returns the current potential number of storage positions and capacity() returns the actual number of things that are stored

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions