Exam 8: Arrays and Strings

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

All components of an array are of the same data type.

Free
(True/False)
5.0/5
(49)
Correct Answer:
Verified

True

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

Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
Verified

C

Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the component type int?

Free
(Multiple Choice)
4.9/5
(49)
Correct Answer:
Verified

D

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

Which of the following correctly declares name to be a character array and stores "William" in it?

(Multiple Choice)
4.8/5
(29)

The declaration char str[] = "Hello there"; declares str to be a string of ____________________ characters.

(Short Answer)
4.9/5
(30)

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

(Multiple Choice)
4.9/5
(42)

Consider the following statement: double alpha[10][5];.The number of components of alpha is ____.

(Multiple Choice)
5.0/5
(46)

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)
5.0/5
(47)

The statement int list[25]; declares list to be an array of 26 components,since the array index starts at 0.

(True/False)
4.8/5
(40)

The statement strlen("Marylin Stewart"); returns ____________________.

(Short Answer)
4.7/5
(39)

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

(Multiple Choice)
4.9/5
(39)

Consider the statement int list[10][8];.Which of the following about list is true?

(Multiple Choice)
4.9/5
(41)

The array index can be any integer less than the array size.

(True/False)
4.9/5
(40)

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

(True/False)
4.8/5
(42)

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++) \quad Cout << list[j] << " "; Cout << endl;

(Multiple Choice)
4.7/5
(41)

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

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(42)

For a list of length n,the ____________________ sort makes exactly (n(n - 1))/2 key comparisons and 3(n-1)item assignments.

(Short Answer)
4.8/5
(30)

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

(Short Answer)
4.8/5
(41)
Showing 1 - 20 of 50
close modal

Filters

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