Question
Question 1 (1 point) Given an array of integers of size 5, how does the computer know where the 3rd indexed variable is located? Question
Question 1 (1 point)
Given an array of integers of size 5, how does the computer know where the 3rd indexed variable is located?
Question 1 options:
It adds 3 to the base address of the array | |
It adds space for 3 integers to the base address of the array | |
It remembers where all the indexed variables of the array are located. | |
None of the above |
Save
Question 2 (1 point)
Which of the following declare an array of 5 characters, and initializes them to some known values?
Question 2 options:
char array[5]={'a','b','c','d','e'}; | |
char array[4]={'a','b','c','d','e'}; | |
char array[5]={''}; | |
char array[]={'a','b','d','e'}; | |
A and C | |
B and D | |
all of the above |
Save
Question 3 (1 point)
The computer remembers the address of which indexed variable(s) in an array? ______
Question 3 options:
The center | |
The first | |
The memory location before the first | |
The Last | |
The memory location after the last |
Save
Question 4 (1 point)
Question 4 options:
Indexes are numbered starting at _________
Save
Question 5 (1 point)
Question 5 options:
How many indexed variables does the following array have? int myArray[12]={1,2,3,6,5,4,7,1,2};
Save
Question 6 (1 point)
The locations of the various indexed variables in an array can be spread out all over the memory.
Question 6 options:
True | |
False |
Save
Question 7 (1 point)
The following function declaration guarantees the values in the array argument are not changed in the function. void function1(int array[], int numElements);
Question 7 options:
True | |
False |
Save
Question 8 (1 point)
Which of the following function declarations correctly expect an array as the first argument?
Question 8 options:
void f1(int array, int size); | |
void f1(int& array, int size); | |
void f1(int array[100], int size); | |
void f1(float array[], int size); | |
All of the above | |
C and D | |
A and B |
Save
Question 9 (1 point)
If you use the const modifier in a function declaration, you do not include it in the function definition.
Question 9 options:
True | |
False |
Save
Question 10 (1 point)
The modifier that guarantees that an array argument will not be changed is called ______.
Question 10 options:
range | |
permanent | |
const | |
domain | |
index | |
key | |
value |
Save
Question 11 (1 point)
Which of the following declare an array of 5 characters, and initializes them to some known values?
Question 11 options:
A) char array[5]={'a','b','c','d','e'}; | |
B) char array[4]={'a','b','c','d','e'}; | |
C) char array[5]={'a'}; | |
D) char array[]={'a','b','d','e'}; | |
A and C | |
B and D | |
A, B, C and D |
Save
Question 12 (1 point)
Give the following declarations, which of the following is a legal call to this function? int myFunction(int myValue); int myArray[1000];
Question 12 options:
cout | |
cout | |
myArray = myFunction(myArray); | |
myArray[1] = myFunction(myArray[0]); | |
A and B | |
A and C | |
B and D |
Save
Question 13 (1 point)
Given an array named scores with 25 elements, what is the correct way to access the 25th element?
Question 13 options:
scores+25 | |
scores[24] | |
scores[25] | |
scores[last] |
Save
Question 14 (1 point)
The computer remembers the address of which indexed variable(s) in an array? ______
Question 14 options:
The center | |
The first | |
The memory location before the first | |
The Last | |
The memory location after the last |
Save
Question 15 (1 point)
Which of the following function declarations could be used to input data from the keyboard into the array?
Question 15 options:
void input(int array[], int &numElements, int MAX_SIZE); | |
void input(int array[], int numElements, int MAX_SIZE); | |
void input(int &array[], int numElements, int MAX_SIZE); | |
int array[] input(int array[], int umElements, int MAX_SIZE); |
Save
Question 16 (1 point)
When you have a function that expects an array, it should also expect the size of the array or the number of indexed variables with valid data.
Question 16 options:
True | |
False |
Save
Question 17 (1 point)
Question 17 options:
How many indexed variables does the following array have? int myArray[12]={1,2,3,6,5,4,7,1,2};
Save
Question 18 (1 point)
The following function declaration guarantees the values in the array argument are not changed in the function. void function1(const int array[], const int numElements);
Question 18 options:
True | |
False |
Save
Question 19 (1 point)
The following function definition has an error in it. What line is this error on? 0. void f1(const double array[], int size) 1. { 2. int i=0; 3. while(i
Question 19 options:
0 | |
2 | |
5 | |
6 | |
2 |
Save
Question 20 (1 point)
In the expression cout
Question 20 options:
base | |
key | |
range | |
delimiter | |
index |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started