Austin Community College District | Start Here. Get There.



COSC 1320 C++ PROGRAMMING

Homework 6

Part I

True/False

1. The amount of memory used by an array depends upon the array's data type and

the number of elements the array can hold.

a. True b. False

2. Array size declarators can be either integer constants or integer variables.

a. True b. False

3. To assign all the contents of one array to another, you can use the

assignment operator.

a. True b. False

4. When you pass an array as an argument to a function, the function can modify

the contents of the array.

a. True b. False

5. A one-dimensional array can only store elements of a single data type, but a

two-dimensional array can hold data of two different data type.

a. True b. False

6. An element of a two-dimensional array is referenced by the array name and two

subscripts, first the element row number and then the element column number.

a. True b. False

7. Any sorting algorithm, such as bubble sort or selection sort, that can be

used on data stored in an array can also be used on data stored in a vector.

a. True b. False

8. Using a binary search, you are more likely to find an item than if you use a

linear search.

a. True b. False

9. The statement

double money[25.0];

is a valid C++ array definition.

a. True b. False

10. In C++ If you attempt to store more data in an array than it can hold, the

compiler will issue an error.

a. True b. False

11. Each individual element of an array can be accessed by the array name and an

element number, called a subscript.

a. True b. False

12. An individual array element can be processed or passed to a function like a

regular C++ variable.

a. True b. False

13. The array definition

int grades[ ];

is legal because C++ allows arrays to be implicitly sized.

a. True b. False

14. When searching for an item in an unordered set of data, binary search can

find the item more quickly than linear search.

a. True b. False

Part II

Multiple Choice

15. An array of 8 integers named scores can have its contents displayed with the

Statement

a. cout ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download