Exam 8: Arrays and Strings
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 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 Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
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)
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--)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)