BCS230 Final || All Correct 100%.
1) Each object of a class has its own copy of the class's correct answers instance member
variables.
2) A(n) ________ member variable may be accessed before any objects of the class have been
declared. correct answers static
3) True/False: When a class declares an entire class as its friend, the friendship status is
reciprocal. That is, each class's member functions have free access to the other's private
members. correct answers FALSE
4) The ________ operator may be used to assign one object to another. correct answers =
5) True/False: By default, when an object is assigned to another, each member of one object is
copied to its counterpart in the other object. correct answers TRUE
6) C++ requires that a copy constructor's parameter be correct answers a reference to an object.
7) C++ allows you to overload correct answers operators and functions.
8) When a class contains a pointer to dynamically allocated memory, it is a good idea to equip
the class with correct answers a copy constructor.
9) True/False: When a class contains a pointer to dynamically allocated memory, it a good idea
to have the class overload the assignment operator. correct answers TRUE
10) True/False: If you overload the prefix ++ operator, the postfix ++ operator is automatically
overloaded also. correct answers FALSE
11) A good reason for overloading an operator is to enable it to correct answers be used with
types defined by the programmer.
12) The process of having a class contain an instance of another class is known as correct
answers object composition.
13) True/False: If a function f is a friend of a class A, and the class A is a friend of a class B,
then the function f is able to access private members of B. correct answers FALSE
14) True/False: C++ permits you to overload the sizeof operator. correct answers FALSE
15) True/False: A static member variable can be used when there are no objects of the class in
existence. correct answers TRUE
16) If you do not furnish a(n) ________, an automatic memberwise copy will be performed when
one object is assigned to another object. correct answers overloaded assignment operator
, 17) It is a good idea to make a copy constructor's parameters ________ by specifying the
________ keyword in the parameter list. correct answers constant, const
18) A reason to overload the ________ is to write classes that have array-like behavior. correct
answers square brackets [ ]
19) True/False: When you overload the << operator, you must also overload the >> operator
correct answers FALSE
20) True/False: You can overload the conditional operator to make it function as an
unconditional operator. correct answers FALSE
21) ________ allows us to create new classes based on existing classes. correct answers
Inheritance
22) When you derive a class from an existing class, you correct answers can add both new data
and new functions.
23) A situation in which every object of a class A has a pointer to an object of a class B, and the
objects of the class B may outlive objects of class A, is called correct answers aggregation.
24) ________ members of a base class are never accessible to a derived class. correct answers
Private
25) The ________ class constructor is called before the ________ class constructor. correct
answers base, derived
26) True/False: In an inheritance situation, you can't pass arguments to a base class constructor.
correct answers FALSE
27) True/False: A derived class may become a base class, if another class is derived from it.
correct answers TRUE
28) In the statement class Car:public Vehicle, which is the base class? correct answers Vehicle
29) Arguments are passed to the base class destructor function by the ________ class ________
function.
A) derived, constructor
B) derived, destructor
C) base, constructor
D) base, destructor
E) None of the above correct answers None of the above
30) True/False: A member function of a derived class may not have the same name as a member
function of a base class. correct answers FALSE
1) Each object of a class has its own copy of the class's correct answers instance member
variables.
2) A(n) ________ member variable may be accessed before any objects of the class have been
declared. correct answers static
3) True/False: When a class declares an entire class as its friend, the friendship status is
reciprocal. That is, each class's member functions have free access to the other's private
members. correct answers FALSE
4) The ________ operator may be used to assign one object to another. correct answers =
5) True/False: By default, when an object is assigned to another, each member of one object is
copied to its counterpart in the other object. correct answers TRUE
6) C++ requires that a copy constructor's parameter be correct answers a reference to an object.
7) C++ allows you to overload correct answers operators and functions.
8) When a class contains a pointer to dynamically allocated memory, it is a good idea to equip
the class with correct answers a copy constructor.
9) True/False: When a class contains a pointer to dynamically allocated memory, it a good idea
to have the class overload the assignment operator. correct answers TRUE
10) True/False: If you overload the prefix ++ operator, the postfix ++ operator is automatically
overloaded also. correct answers FALSE
11) A good reason for overloading an operator is to enable it to correct answers be used with
types defined by the programmer.
12) The process of having a class contain an instance of another class is known as correct
answers object composition.
13) True/False: If a function f is a friend of a class A, and the class A is a friend of a class B,
then the function f is able to access private members of B. correct answers FALSE
14) True/False: C++ permits you to overload the sizeof operator. correct answers FALSE
15) True/False: A static member variable can be used when there are no objects of the class in
existence. correct answers TRUE
16) If you do not furnish a(n) ________, an automatic memberwise copy will be performed when
one object is assigned to another object. correct answers overloaded assignment operator
, 17) It is a good idea to make a copy constructor's parameters ________ by specifying the
________ keyword in the parameter list. correct answers constant, const
18) A reason to overload the ________ is to write classes that have array-like behavior. correct
answers square brackets [ ]
19) True/False: When you overload the << operator, you must also overload the >> operator
correct answers FALSE
20) True/False: You can overload the conditional operator to make it function as an
unconditional operator. correct answers FALSE
21) ________ allows us to create new classes based on existing classes. correct answers
Inheritance
22) When you derive a class from an existing class, you correct answers can add both new data
and new functions.
23) A situation in which every object of a class A has a pointer to an object of a class B, and the
objects of the class B may outlive objects of class A, is called correct answers aggregation.
24) ________ members of a base class are never accessible to a derived class. correct answers
Private
25) The ________ class constructor is called before the ________ class constructor. correct
answers base, derived
26) True/False: In an inheritance situation, you can't pass arguments to a base class constructor.
correct answers FALSE
27) True/False: A derived class may become a base class, if another class is derived from it.
correct answers TRUE
28) In the statement class Car:public Vehicle, which is the base class? correct answers Vehicle
29) Arguments are passed to the base class destructor function by the ________ class ________
function.
A) derived, constructor
B) derived, destructor
C) base, constructor
D) base, destructor
E) None of the above correct answers None of the above
30) True/False: A member function of a derived class may not have the same name as a member
function of a base class. correct answers FALSE