Exam 8: Arrays and Strings

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When you pass an array as a parameter,the base address of the actual array is passed to the formal parameter.

(True/False)
4.8/5
(41)

Consider the following declaration: int alpha[5] = {3,5,7,9,11};.Which of the following is equivalent to this statement?

(Multiple Choice)
4.9/5
(36)

The ____________________ sort algorithm finds the location of the smallest element in the unsorted portion of the list and moves it to the top of the unsorted portion of the list.

(Short Answer)
4.9/5
(45)

Suppose that sales is an array of 50 components of type double.Which of the following correctly initializes the array sales?

(Multiple Choice)
4.9/5
(34)

What is the output of the following C++ code? int alpha[5] = {2,4,6,8,10}; int j; for (j = 4; j >= 0; j--) \quad cout << alpha[j] << " "; cout << endl;

(Multiple Choice)
4.8/5
(42)

The function ____________________ returns the length of the string s,excluding the null character.

(Short Answer)
4.8/5
(41)

The ____________________ of an array is the address (that is,the memory location)of the first array component.

(Short Answer)
4.9/5
(42)

Consider the following declaration: char str[15];.Which of the following statements stores "Blue Sky" into str?

(Multiple Choice)
4.9/5
(37)

Given the declaration int list[20]; the statement list[12] = list[5] + list[7]; updates the content of the twelfth component of the array list.

(True/False)
4.8/5
(42)

Given the following declaration: int j; int sum; double sale[10][7]; Which of the following correctly finds the sum of the elements of the fifth row of sale?

(Multiple Choice)
4.8/5
(30)

Suppose that gamma is an array of 50 components of type int and j is an int variable.Which of the following for loops sets the index of gamma out of bounds?

(Multiple Choice)
4.8/5
(30)

The one place where C++ allows aggregate operations on arrays is the input and output of C-strings.

(True/False)
4.9/5
(31)

The word ____________________ is used before the array declaration in a function heading to prevent the function from modifying the array.

(Short Answer)
5.0/5
(40)

The following statements store the value ____________________ into len. int len; len = strlen("Sunny California");

(Short Answer)
4.8/5
(29)

In a(n)____________________ data type,each data item is a collection of other data items.

(Short Answer)
4.9/5
(37)

Consider the following declaration: char charArray[51]; Char discard; Assume that the input is: Hello There! How are you? What is the value of discard after the following statements execute? cin.get(charArray,51); cin.get(discard);

(Multiple Choice)
5.0/5
(41)

The following statement creates alpha to be a two-dimensional array with ____________________ rows. int alpha[10][25];

(Short Answer)
4.8/5
(42)

Two (or more)arrays are called ____________________ if their corresponding components hold related information.

(Short Answer)
4.9/5
(41)

In the following declaration,the array gamma has ____________________ components. int gamma[5][6][10];

(Short Answer)
4.9/5
(33)

In row order form,the ____.

(Multiple Choice)
4.7/5
(35)
Showing 21 - 40 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)