Exam 8: Arrays
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures II Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes43 Questions
Exam 13: Overloading and Templates41 Questions
Exam 14: Exception Handling42 Questions
Exam 15: Recursion41 Questions
Exam 16: Searching and Sorting46 Questions
Exam 17: Linked Lists41 Questions
Exam 18: Stacks and Queues42 Questions
Select questions type
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.7/5
(87)
Suppose that sales is an array of 50 components of type double. Which of the following correctly initializes the array sales?
(Multiple Choice)
4.8/5
(75)
Assume you have the following declaration int beta[50];. Which of the following is a valid element of beta?
(Multiple Choice)
4.9/5
(79)
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)
4.8/5
(71)
In a two-dimensional array, the elements are arranged in a table form.
(True/False)
5.0/5
(70)
Assume you have the following declaration char nameList[100];. Which of the following ranges is valid for the index of the array nameList?
(Multiple Choice)
4.8/5
(68)
Which of the following statements declares alpha to be an array of 25 components of the type int?
(Multiple Choice)
4.9/5
(72)
Consider the following declaration: char str[15];. Which of the following statements stores "Blue Sky" into str?
(Multiple Choice)
5.0/5
(83)
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.7/5
(76)
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.7/5
(87)
Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the component type int?
(Multiple Choice)
4.7/5
(93)
The word ____________________ is used before the array declaration in a function heading to prevent the function from modifying the array.
(Short Answer)
4.7/5
(80)
The form of the for loop shown below is called a(n) ____________________ for loop.
for (dataType identifier : arrayName)
statements
(Short Answer)
4.8/5
(79)
Given the following declaration:
which of the following correctly finds the sum of the elements of the fourth column of sale?
(Multiple Choice)
4.8/5
(80)
The one place where C++ allows aggregate operations on arrays is the input and output of C-strings.
(True/False)
4.9/5
(87)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)