Question: C++ PROGRAMMING Question 1 A one-dimensional array is a list of related values with the same ____ that is stored using a single group name.
C++ PROGRAMMING
Question 1
A one-dimensional array is a list of related values with the same ____ that is stored using a single group name.
|
| size | |
|
| data type | |
|
| value | |
|
| offset |
Question 2
Consider the declarations const int ARRAYSIZE = 7; and double length[ARRAYSIZE] = {7.8, 6.4, 4.9, 11.2};. How many elements will be initialized to zero?
|
| none | |
|
| one | |
|
| two | |
|
| three |
Question 3
The statement cin >> grade[4] >> prices[6]; causes ____ values to be read and stored.
|
| 2 | |
|
| 4 | |
|
| 6 | |
|
| 10 |
Question 4
Passing addresses is referred to as a function pass by reference because the called function can reference, or access, the variable whose address has been passed.
True
False
Question 5
A called function can return more than one legitimate value to its calling function.
True
False
Question 6
| The new and delete operators provide a mechanism for enlarging and shrinking arrays. | |||||||
| |||||||
Question 7
| Under a dynamic allocation scheme, the amount of storage to be allocated is determined and adjusted ____. | |||||||||||
| |||||||||||
Question 8
| For dynamic allocation of memory to create new variables as a program is running, pointers are ____. | |||||||||||
| |||||||||||
Question 9
| Adding 1 to a pointer causes the pointer to point to the ____. | |||||||||||
| |||||||||||
Question 10
| The expression *gPtr + 3 is equivalent to *(gPtr + 3). | |||||||
| |||||||
Question 11
| Any subscript used by a programmer is automatically converted to a(n) ____ by the compiler. | ||||||||||||
| ||||||||||||
| QUESTION 12 | What is the output of the following C++ code? int *p = new int; int *q = new int; p = q; *q = 75; delete p; p = new int; *p = 26; q = new int; q = p; *q = 62; cout << *p << " " << *q << endl; | |||||||||||
| ||||||||||||
Question 13
|
| A class ____ automatically executes whenever a class object goes out of scope. | ||||||||||||
| |||||||||||||
Question 14
|
| C++ does not perform array bounds checking, making it possible for you to assign a pointer the address of an element out of the boundaries of an array. | ||||||||
| |||||||||
Question 15
1 out of 1 points
|
| If a is a class object and p, a pointer, is a public member of the class, what will the following statement do? cout << *a.p; | ||||||||||
| |||||||||||
Question 16
|
| Which of the following is true about classes and structs? | ||||||||||||
| |||||||||||||
Question 17
| What will the following code display? int numbers[] = { 99, 87, 66, 55, 101 }; for (int i = 1; i < 4; i++) cout << numbers[i] << " "; | |||||||||||
| |||||||||||
Question 18
| Given the declaration Student *student;, the statement student = new Student[50]; dynamically allocates a dynamic array of the type ____. | |||||||||||
| |||||||||||
Question 19
| Which is Abstract Data Type in C++ | |||||||||||
| |||||||||||
Question 20
| By default functions available in C++ language are | |||||||||||||
| |||||||||||||
Question 21
| What is the output of this program? 1. #include 2. using namespace std; 3. int main () 4. { 5. int numbers[5]; 6. int * p; 7. p = numbers; *p = 10; 8. p++; *p = 20; 9. p = &numbers[2]; *p = 30; 10. p = numbers + 3; *p = 40; 11. p = numbers; *(p + 4) = (*p) *2; 12. for (int n = 0; n < 5; n++) 13. cout << numbers[n] << ","; 14. return 0; 15. } | |||||||||||
| |||||||||||
Question 22
| A linked list is a random access data structure such as an array. | |||||||
| |||||||
Question 23
| Because initially the list is empty, the pointer listData must be initialized to ____. | |||||||||||
| |||||||||||
Question 24
| In a linked list, we always want listData to point to the ____ node. | |||||||||||
| |||||||||||
Question 25
| To access the fifth element in a list, we must first traverse the first four elements. | |||||||
| |||||||
Question 26
| To delete a given item from an ordered linked list, there is no need to search the list to see whether the item to be deleted is in the list. | |||||||
| |||||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
