Exam 8: Arrays and Strings

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

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

(Short Answer)
4.8/5
(39)

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

(Multiple Choice)
5.0/5
(39)

In C++, the null character is represented as ____.

(Multiple Choice)
4.7/5
(39)

Which of the following statements declares alpha to be an array of 25 components of the type int?

(Multiple Choice)
4.7/5
(41)

What is the value of alpha[2] after the following code executes? int alpha[5]; Int j; For (j = 0; j < 5; j++) Alpha[j] = 2 * j + 1;

(Multiple Choice)
4.8/5
(39)

Suppose that list is an array of 10 components of type int. Which of the following codes correctly outputs all the elements of list?

(Multiple Choice)
4.9/5
(30)

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

(Short Answer)
4.8/5
(37)

Assume you have the following declaration int beta[50];. Which of the following is a valid element of beta?

(Multiple Choice)
4.9/5
(35)

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.7/5
(32)

Consider the following statement: int alpha[25][10];. Which of the following statements about alpha is true?

(Multiple Choice)
4.8/5
(34)

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
(37)

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

(Short Answer)
4.8/5
(37)

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.9/5
(40)

What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 1; j <= 5; j++) cout << list[j] << " "; cout << endl;

(Multiple Choice)
4.9/5
(32)

Assume you have the following declaration double salesData[1000];. Which of the following ranges is valid for the index of the array salesData?

(Multiple Choice)
4.9/5
(37)

In row order form, the ____.

(Multiple Choice)
4.7/5
(34)

If an array index goes out of bounds, the program always terminates in an error.

(True/False)
4.7/5
(33)

A data type is called ____________________ if variables of that type can store only one value at a time.

(Short Answer)
4.9/5
(31)

Suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list. sum = 0; for (int i = 0; i < 25; i++) sum = sum + list;

(True/False)
4.9/5
(35)

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

(Multiple Choice)
4.9/5
(38)
Showing 21 - 40 of 50
close modal

Filters

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