Multiple Choice Questions 1. (TCO 4) Which of the following is not true about pu
ID: 3541150 • Letter: M
Question
Multiple Choice Questions
1. (TCO 4) Which of the following is not true about public inheritance? (Points : 4) All public member functions of the base class become the public member functions of the derived class.All public member variables of the base class become the public member variables of the derived class.
All public members of the base class become the public members of the derived class.
The public member variables of the base class become the private member variables of the derived class.
2. (TCO 6) Which of the following operators may not be overloaded? (Points : 4) =
::
||
&&
3. (TCO 6) The return type of the function operator == is ____. (Points : 4) int
char
bool
void
4. (TCO 6) A unary operator is one that: (Points : 4) only has one operand.
only has one operator.
increments or decrements an integer variable by one.
is used to increment or decrement loop counters.
5. (TCO 6) Which of the following statements is true for the C++ language? (Points : 4) The precedence of an operator can be changed.
Every instance of an overloaded operator has the same number of parameters.
It is not necessary to overload relational operators for classes that have only int member variables.
The post-increment (++) and the pre-increment (++) operators prototype must be the same as they use the same symbols (++).
6. (TCO 6) What is a friend function? (Points : 4) An overloaded operator
A function in a derived class that overrides a base class function of the same name
A non-member function of a class, but which has access to all of the members of the class
A function called by member function of a class
7. (TCO 7) Static binding is a process which is (Points : 4) performed during run-time operation of the program.
performed during the linking operation of the program.
performed during the compilation of the program.
performed only when the static option is set in the compile options.
8. (TCO 7) Overriding a base class member function with a derived member function demonstrates the concept of (Points : 4) overloading.
inheritance.
polymorphism.
abstraction.
9. (TCO 7) Virtual functions are first declared in what class? (Points : 4) The base class
The derived class
In both the base and derived classes
In neither the base nor the derived class
10. (TCO 7) If a class is abstract then (Points : 4) no objects may be instantiated of that class.
any and all objects of that class must be declared as virtual also.
its destructor must also be virtual.
it provides a blueprint for objects instantiated from it.
11. (TCO 7) With virtual functions and polymorphism, the programmer can (Points : 4) have all object definitions defined during compilation.
have all object definitions defined during linking.
have the object definitions defined during run-time.
explicitly define all class relationships in the program code.
12. (TCO 8) Which is a correct preprocessor directive statement? (Points : 4) define PI = 3.141593
define PI = 3.141593;
#define PI 3.141593
#define PI = 3.141593
13. (TCO 8) In the following statement, list the C++ reserved word(s).
using namespace std; (Points : 4) using, namespace, and std
using and namespace
using
namespace
14. (TCO 8) If Class A has an object of Class B as a data member, what type of function must be used for an object of Class A to obtain a copy of a private data member of Class B? (Points : 4) Class B copy constructor
Class B accessor function
Class A accessor function
It is not possible for an object of Class A to do this action.
Explanation / Answer
1. (TCO 4) Which of the following is not true about public inheritance? (Points : 4)
The public member variables of the base class become the private member variables of the derived class.
2. (TCO 6) Which of the following operators may not be overloaded? (Points : 4)
::
3. (TCO 6) The return type of the function operator == is ____. (Points : 4)
bool
4. (TCO 6) A unary operator is one that: (Points : 4)
only has one operand.
5. (TCO 6) Which of the following statements is true for the C++ language? (Points : 4)
It is not necessary to overload relational operators for classes that have only int member variables.
6. (TCO 6) What is a friend function? (Points : 4)
A non-member function of a class, but which has access to all of the members of the class
7. (TCO 7) Static binding is a process which is (Points : 4)
performed during the compilation of the program.
8. (TCO 7) Overriding a base class member function with a derived member function demonstrates the concept of (Points : 4)
polymorphism.
9. (TCO 7) Virtual functions are first declared in what class? (Points : 4)
The base class
10. (TCO 7) If a class is abstract then (Points : 4)
no objects may be instantiated of that class.
11. (TCO 7) With virtual functions and polymorphism, the programmer can (Points : 4)
have all object definitions defined during compilation.
12. (TCO 8) Which is a correct preprocessor directive statement? (Points : 4)
#define PI 3.141593
13. (TCO 8) In the following statement, list the C++ reserved word(s).
using namespace std; (Points : 4)
using and namespace
14. (TCO 8) If Class A has an object of Class B as a data member,
what type of function must be used for an object of Class A to obtain a copy of a private data member of Class B? (Points : 4)
Class B accessor function
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.