Do My Essay!
Do not waste time. Get a complete paper today.
Our leading custom writing service provides custom written papers in 80+ disciplines. Order essays, research papers, term papers, book reviews, assignments, dissertation, thesis or extensive dissertations & our expert ENL writers will easily prepare a paper according to your requirements.
You’ll get your high quality plagiarism-free paper according to your deadline! No Bullshit!!
Special offer! Get 20% discount on your first order. Promo code: SAVE20
Question Completion Status:
Question 1
1. Suppose that printHeadingis a function without any parameters. Which of the following is a valid
function heading?
2. 3. 4. void printHeading()?
5. 6. 7. void printHeading()
8. 9. 10. void printHeading(noParameters)?
11. 12.13. void printHeading(void)
3 points
Question 2
1. Which of the following is a legal C++ function definition?
2. 3. 4. void funcTest(int& u, double& v){ cout << u << ” ” << v << endl?}
5. 6. 7. void funcTest(int& u, double& v)?{ cout << u << ” ” << v <<
endl?}
8. 9. 10. void funcTest(int& u, double& v)( cout << u << ” ” << v << endl)
11. 12.13. void funcTest(int& u, double& v)[ cout << u << ” ” << v << endl?]
3 points
Question 3
1. There are two types of ____ parameters: value parameters and reference parameters.
2. 3. 4. actual
5. 6. 7. formal
8. 9. 10. active
11. 12.13. passive
3 points
Question 4
1. If an & is attached after the data type of a formal parameter, then the formal parameter is a ____.
2. 3. 4. value parameter
5. 6. 7. reference parameter
8. 9. 10. global variable
11. 12.13. default variable
3 points
Question 5
1. A void function accomplish has three parameters: a parameter u of type int, a parameter v of
type double, and a parameter letter of type char. The parameters uand letter need to pass
their values out of the function and the parameter v is to only receive the value from the calling
environment. Which of the following is a correct function heading?
2. 3. 4. void accomplish(int& u, double v, char& letter)
5. 6. 7. void accomplish(int u, double& v, char letter)
8. 9. 10. void accomplish(int& u, double v, char& letter)?
11. 12.13. void accomplish(int u, double& v, char letter)?
3 points
Question 6
1. Consider the following definition.void funBbeta(int& one, double two){ …}Based on this
function definition, which of the following statements is valid?
2. 3. 4. one is a value parameter and two is a reference parameter.
5. 6. 7. one is a reference parameter and two is a value parameter.
8. 9. 10. one and two are reference parameters.
11. 12.13. one and two are value parameters.
3 points
Question 7
1. Which of the following is a legal C++ function definition?
2. 3. 4. void funcAlpha(int u, double v &){ cout << u << ” ” << v <<
endl?}
5. 6. 7. void funcAlpha(int #, double #){ cout << u << ” ” << v << endl?}
8. 9. 10. void funcAlpha(int &, double &){ cout << u << ” ” << v << endl?}
11. 12.13. void funcAlpha(int u, double& v){ cout <<u << ” ” << v << endl?}
3 points
Question 8
1. During program execution, a(n) ____ parameter manipulates the data stored in its own memory
space.
2. 3. 4. formal value
5. 6. 7. actual
8. 9. 10. active
11. 12.13. passive
3 points
Question 9
1. When a function is called, the value of the ____ parameter is copied into the corresponding formal
parameter.
2. 3. 4. reference
5. 6. 7. default
8. 9. 10. actual
11. 12.13. static
3 points
Question 10
1. If a formal parameter is a nonconstant
reference parameter, its corresponding actual parameter
during a function call must be a(n) ____.
2. 3. 4. default value
5. 6. 7. value
8. 9. 10. expression
11. 12.13. variable
3 points
Question 11
1. You can declare a(n) ____ parameter as a constant by using the keyword const.
2. 3. 4. absolute
5. 6. 7. relative
8. 9. 10. reference
11. 12.13. actual
3 points
Question 12
1. Suppose that you have the following function.
2. void mystery(int& one, int two){ int temp temp = one? one =
two? two = temp?}
3. What are the values of x and y after the following statements? (Assume that variables are
properly declared.)
4. x = 10?y = 15?mystery(x, y)?
5. 6. 7. x = 10? y = 10
8. 9. 10. x = 10? y = 15
11. 12.13. x = 15? y = 10
14. 15.16. x = 15? y = 15
3 points
Question 13
1. Consider the following function definition.
2. void strange(int& u, char& ch){ int a? a = u++? u = 2 * u? a =
static_cast<int>(ch)? a++? ch = static_cast<char>(a)?
3. }What are the values of one and letter after the following statements execute?int one
=5?char letter = ‘A’?strange(one, letter)?
4. 5. 6. one = 5? letter = ‘A’
7. 8. 9. one = 10? letter = ‘A’
10. 11.12. one = 10? letter = ‘B’
13. 14.15. one = 12? letter = ‘B’
3 points
Question 14
1. ____ identifiers are not accessible outside of the function (block).
2. 3. 4. Local
5. 6. 7. Global
8. 9. 10. Internal
11. 12.13. External
3 points
Question 15
1. In C++, the scope resolution operator is ____.
2. 3. 4. |
5. 6. 7. .
8. 9. 10. :
11. 12.13. ::
3 points
Question 16
1. To declare w as an external variable of type int inside the function, the function must contain
which statement?
2. 3. 4. external w
5. 6. 7. external int w?
8. 9. 10. extern w
11. 12.13. extern int w?
3 points
Question 17
1. A variable for which memory is allocated at block entry and deallocated at block exit is called a(n)
____ variable.
2. 3. 4. side effect
5. 6. 7. static
8. 9. 10. automatic
11. 12.13. global
3 points
Question 18
1. Suppose that you have the following declaration. enum cars {FORD, GM, TOYOTA,
HONDA}?cars domesticCars = FORD?The statement domesticCars =
static_cast<cars>(domesticCars + 1)? sets the value of domesticCars to ____.
2. 3. 4. FORD
5. 6. 7. GM
8. 9. 10. TOYOTA
11. 12.13. HONDA
3 points
Question 19
1. What is the output of the following code?enum courses {ALGEBRA, BASIC, PASCAL,
PHILOSOPHY, ANALYSIS}?courses registered?registered = ALGEBRA?cout <<
registered << endl?
2. 3. 4. ALGEBRA
5. 6. 7. 0
8. 9. 10. 1
11. 12.13. “ALGEBRA”
3 points
Question 20
1. Which of the following statements creates an anonymous type?
2. 3. 4. enum grades {A, B, C, D, F}?
5. 6. 7. enum grades {}?
8. 9. 10. enum {}?
11. 12.13. enum {A, B, C, D, F} grades?
3 points
Question 21
1. In C++, ____ is a reserved word.
2. 3. 4. deftype
5. 6. 7. typedef
8. 9. 10. typecc
11. 12.13. alias
3 points
Question 22
1. In July ____, the ANSI/ISO Standard C++ was officially approved.
2. 3. 4. 1996
5. 6. 7. 1998
8. 9. 10. 1999
11. 12.13. 2000
3 points
Question 23
1. In C++, ____ is called the scope resolution operator.
2. 3. 4. .
5. 6. 7. ?
8. 9. 10. :
11. 12.13. ::
3 points
Question 24
1. The scope of a namespace member is local to the ____.
2. 3. 4. function
5. 6. 7. block
8. 9. 10. file
11. 12.13. namespace
3 points
Question 25
1. Which of the following statements is used to simplify the accessing of all globalType namespace
members?
2. 3. 4. using globalType?
5. 6. 7. using namespace globalType:all?
8. 9. 10. using namespace globalType::all?
11. 12.13. using namespace globalType?
3 points
Question 26
1. Before using the data type string, the program must include the header file ____.
2. 3. 4. enum
5. 6. 7. iostream
8. 9. 10. string
11. 12.13. std
3 points
Question 27
1. Suppose that str1, str2, and str3 are string variables. After the following statements execute,
the value of str3 is “____”.
2. str1 = “abc”?str2 = “xyz”?
3. str3 = str1 + ”
+ str2?
4. 5. 6. abc
7. 8. 9. xyz
10. 11.12. abcxyz
13. 14.15. xyzabc
3 points
Question 28
1. Suppose str = “xyzw”?. After the statement str[2] = ‘Y’? The value of str is “____”.
2. 3. 4. xyzw
5. 6. 7. xYzw
8. 9. 10. xyYw
11. 12.13. xzYw
3 points
Question 29
1. Suppose str = “ABCDEFGHI”. The output of the statement cout << str.length() << endl?
is ____.
2. 3. 4. 7
5. 6. 7. 8
8. 9. 10. 9
11. 12.13. 10
3 points
Question 30
1. The length of the string “Hello There. ” is ____.
2. 3. 4. 11
5. 6. 7. 12
8. 9. 10. 13
11. 12.13. 14
3 points
Question 31
1. Consider the following statements. string str = “ABCDEFD”?string::size_type
position?After the statement position = str.find(‘D’)? executes, the value of position is
____.
2. 3. 4.
5. 6. 7.
8. 9. 10.
11. 12.13.
3 points
Question 32
1. Consider the following statements.
2. string str1 = “ABCDEFGHIJKLM”?string str2?
3. After the statement str2 = str1.substr(1,4)? executes, the value of str2 is “____”.
4. 5. 6. ABCD
7. 8. 9. BCDE
10. 11.12. BCD
13. 14.15. CDE
3 points
Question 33
1. Consider the following statements.
2. string str1 = “Gone with the wind”?
3. string str2?After the statement str2 = str1.substr(5,4)? executes, the value of str2 is
“____”.
4. 5. 6. Gone
7. 8. 9. with
10. 11.12. the
13. 14.15. wind
3 points
Question 34
1. The ____ function is used to interchange the contents of two string variables.
2. 3. 4. iterator
5. 6. 7. traverse
8. 9. 10. swap
11. 12.13. change
3 points
Question 35
1. Which of the following statements declares alpha to be an array of 25 components of the type
int?
2. 3. 4. int alpha[25]?
5. 6. 7. int array alpha[25]?
8. 9. 10. int alpha[2][5]?
11. 12.13. int array alpha[25][25]?
3 points
Question 36
1. Assume you have the following declaration int beta[50]?. Which of the following is a valid
element of beta?
2. 3. 4. beta[‘2’]
5. 6. 7. beta[‘3’]
8. 9. 10. beta[0]
11. 12.13. beta[50]
3 points
Question 37
1. Suppose that list is an array of 10 components of type int. Which of the following codes
correctly outputs all the elements of list?
2. 3. 4. for (int j = 1? j < 10? j++) cout << list[j] << ” “?cout << endl?
5. 6. 7. for (int j = 0? j <= 9? j++) cout << list[j] << ” “?cout << endl?
8. 9. 10. for (int j = 1? j < 11? j++) cout << list[j] << ” “?cout << endl?
11. 12.13. for (int j = 1? j <= 10? j++) cout << list[j] << ” “?cout << endl?
3 points
Question 38
1. What is the output of the following C++ code?
2. int list[5] = {0, 5, 10, 15, 20}?int j?for (j = 0? j < 5? j++) cout <<
list[j] << ” “?cout << endl?
3. 4. 5. 0 1 2 3 4
6. 7. 8. 0 5 10 15
9. 10.11. 0 5 10 15 20
12. 13.14. 5 10 15 20
3 points
Question 39
1. What is the value of alpha[2] after the following code executes?
2. int alpha[5]?int j?for (j = 0? j < 5? j++)
3. alpha[j] = 2 * j + 1?
4. 5. 6.
7. 8. 9.
10. 11.12.
13. 14.15.
3 points
Question 40
1. What is the output of the following C++ code?int alpha[5] = {2, 4, 6, 8, 10}?int j?for
(j = 4? j >= 0? j)
cout << alpha[j] << ” “?
2. cout << endl?
3. 4. 5. 2 4 6 8 10
6. 7. 8. 4 3 2 1 0
9. 10.11. 8 6 4 2 0
12. 13.14. 10 8 6 4 2
3 points
Question 41
1. What is the output of the following C++ code?
2. int list[5] = {0, 5, 10, 15, 20}?int j?for (j = 1? j <= 5? j++) cout <<
list[j] << ” “?cout << endl?
3. 4. 5. 0 5 10 15 20
6. 7. 8. 5 10 15 20 0
9. 10.11. 5 10 15 20 20
12. 13.14. Code contains index outofbounds
3 points
Question 42
1. 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?
2. 3. 4. for (j = 0? j <= 49? j++) cout << gamma[j] << ” “?
5. 6. 7. for (j = 1? j < 50? j++) cout << gamma[j] << ” “?
8. 9. 10. for (j = 0? j <= 50? j++) cout << gamma[j] << ” “?
11. 12.13. for (j = 0? j <= 48? j++) cout << gamma[j] << ” “?
3 points
Question 43
1. Consider the following declaration int alpha[5] = {3, 5, 7, 9, 11}?. Which of the following
is equivalent to this statement?
2. 3. 4. int alpha[] = {3, 5, 7, 9, 11}?
5. 6. 7. int alpha[] = {3 5 7 9 11}?
8. 9. 10. int alpha[5] = [3, 5, 7, 9, 11]?
11. 12.13. int alpha[] = (3, 5, 7, 9, 11)?
3 points
Question 44
1. Consider the following declaration int alpha[3]?. Which of the following input statements
correctly inputs values into alpha?
2. 3. 4. cin >> alpha >> alpha >> alpha?
5. 6. 7. cin >> alpha[0]>> alpha[1] >> alpha[2]?
8. 9. 10. cin >> alpha[1]>> alpha[2] >> alpha[3]?
11. 12.13. cin >> alpha
3 points
Question 45
1. In C++, the null character is represented as ____.
2. 3. 4. ‘