Exam 8: Arrays
Exam 1: Introduction to Computers and Programming40 Questions
Exam 2: Introduction to C Plus Plus40 Questions
Exam 3: Expressions and Interactivity40 Questions
Exam 4: Making Decisions40 Questions
Exam 5: Looping40 Questions
Exam 6: Functions40 Questions
Exam 7: Introduction to Classes and Objects40 Questions
Exam 8: Arrays40 Questions
Exam 9: Searching, Sorting, Algorithm Analysis40 Questions
Exam 10: Pointers62 Questions
Exam 11: More About Classes and Object-Oriented Programming70 Questions
Exam 12: More on C-Strings and the String Class40 Questions
Exam 13: Advanced File and Io Operations40 Questions
Exam 14: Recursion20 Questions
Exam 15: Polymorphism and Virtual Functions22 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library Stl40 Questions
Exam 17: Linked Lists38 Questions
Exam 18: Stacks and Queues36 Questions
Exam 19: Binary Trees38 Questions
Select questions type
On each iteration of the following range-based for loop for (int element : myArray)
Cout << element << endl;
The variable element holds
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
A
After carrying out the following two statements, sales will have been created as a one-dimensional array that can hold 20 double values.
typedef salesArray double[20];
salesArray sales;
Free
(True/False)
4.9/5
(38)
Correct Answer:
True
The amount of memory used by an array depends solely on the number of elements the array can hold.
Free
(True/False)
4.8/5
(29)
Correct Answer:
False
When you create a vector it is unnecessary to specify how many elements it will hold because it will expand in size as you add new values to it.
(True/False)
4.8/5
(33)
To access an array element, use the array name and the element's
(Multiple Choice)
4.8/5
(37)
What does the following statement do?
Typedef int oneDArray[20];
(Multiple Choice)
4.8/5
(32)
The size of an array is the number of elements that have data stored in them.
(True/False)
4.7/5
(34)
When an array is passed to a function, it is actually ________ the array that is passed.
(Multiple Choice)
4.9/5
(36)
The following statement for(int val : myArray)
Cout << val << " ";
Is an example of a(n)
(Multiple Choice)
4.8/5
(43)
Any of the following statements can be used to initialize the integer variable num to 7;
int num = 7;
int num(7);
int num{7};
(True/False)
4.9/5
(32)
You can assign the contents of one array to another by using
(Multiple Choice)
4.8/5
(34)
The following array definition is legal because C++ allows arrays to be implicitly sized.
int grades[ ];
(True/False)
4.8/5
(45)
An array can be returned by a function as well as passed to a function.
(True/False)
4.8/5
(26)
Elements of vectors can be access by using the vector name and a subscript, similarly to how array elements are accessed.
(True/False)
4.9/5
(31)
Each individual element of an array can be accessed by the array name and an element number, called a subscript.
(True/False)
4.9/5
(33)
If a C++ program contains the following array definition
int score[10];
the following statement would store 100 in the first array element:
score[1] = 100;
(True/False)
4.8/5
(44)
When you pass an array as an argument to a function, the function can modify the contents of the array.
(True/False)
4.7/5
(35)
To step through a one-dimensional array, accessing the elements one by one, it would be most appropriate to use ________ loop.
(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)