verified solutions
Here is the header for a function named compute Value:
Which of the following is a valid call to the function? - correct answer ✔✔compute Value(10);
This function causes a program to terminate, regardless of which function or control mechanism is
executing. - correct answer ✔✔exit()
An array's size declarator must be a ________ with a value greater than ________. - correct answer
✔✔Constant integer expression with a value greater than 0
A two-dimensional array of characters can contain ________. - correct answer ✔✔all of these
Which of the following is a valid C++ array definition? - correct answer ✔✔int array[10];
The range-based for loop, in C++ 11, is designed to work with a built-in variable known as the ________.
- correct answer ✔✔range variable
A ________ argument is passed to a parameter when the actual argument is left out of the function call.
- correct answer ✔✔default
Arrays may be ________ at the time they are ________. - correct answer ✔✔Initialized at the time they
are declared
Which statement correctly defines a vector object for holding integers? - correct answer
✔✔vector<int>v;
Which line in the following program contains the header for the showDub function?
, 1 #include <iostream>
2 using namespace std;
3
4 void showDub(int);
5
6 int main()
7{
8 int x = 2;
9
10 showDub(x);
11 cout << x << endl;
12 return 0;
13 }
14
15 void showDub(int num)
16 {
17 cout << (num * 2) << endl;
18 } - correct answer ✔✔15, void showDub(int num)
The statement:
int grades[ ] = { 100, 90, 99, 80};
shows an example of: - correct answer ✔✔implicit array sizing
True/False: You may use the exit() function to terminate a program, regardless of which control
mechanism is executing. - correct answer ✔✔True
True/False: If an array is partially initialized, the uninitialized elements will be set to zero. - correct
answer ✔✔True