Exam 8: Arrays and Strings
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
All components of an array are of the same data type.
Free
(True/False)
5.0/5
(49)
Correct Answer:
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++)
cout << list[j] << " ";
cout << endl;
Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
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:
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)
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++)
Cout << list[j] << " ";
Cout << endl;
(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.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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)