COP 3330 Questions and Answers Rated A+
(T/F) A conversion constructor is a constructor that can be called with just one
parameter - ANSWER-True
(T/F) a derived class constructor will always first call its base class constructor -
ANSWER-true
(T/F) a protected member function of class X is accessible from class X and from any
class that X is derived from - ANSWER-false
(T/F) all arrays of type char are considered c-stye strings - ANSWER-false
(T/F) An R-Value is an expression that represents a modifiable storage location -
ANSWER-False
(T/F) cstring library functions, like strcpy, will protect the caller from overflowing array
boundaries on character arrays - ANSWER-false
(T/F) Every class has a default constructor - ANSWER-false
(T/F) Function calls are checked against their prototypes during the compiling stage of a
program build (not during the linking stage)_ - ANSWER-True
(T/F) If [Thing] is an abstract class, it is illegal to declare pointers of type [Thing*] -
ANSWER-False
(T/F) If a binary operator is overloaded and written as a member function of a class, the
function takes two parameters - ANSWER-False
(T/F) If a member data variable of a class is declared it be CONST, then its value is
fixed and is the same for all objects of that class type - ANSWER-False
(T/F) If class [C] is derived from class [P], a pointer of type [(C*)] can point to an object
of type [P] - ANSWER-false
(T/F) if class C is derived from class B, a pointer of type (C*) can point to an object of
type B - ANSWER-false (if said B* it would be true)
(T/F) if ptr is a pointer, then *ptr refers to the target of that pointer - ANSWER-true
(T/F) if the programmer doesn't write a copy constructor for a class, one will
automatically be created by the compiler - ANSWER-true
(T/F) if the programmer doesn't write the equality operator = for a class, one will
automatically be created by the compiler - ANSWER-false
, (T/F) if XXX is an abstract class, it is illegal to declare objects of type XXX - ANSWER-
true
(T/F) if XXX is an abstract class, it is illegal to declare objects of type XXX - ANSWER-
true
(T/F) In C++, a class can be derived directly from more than one base class -
ANSWER-true
(T/F) the automatic shallow copy is sufficient for an object as long as the object does
not have any arrays as member data - ANSWER-false
(T/F) the automatic shallow copy is sufficient for an object as long as the object does
not have any pointers or reference variables as member data - ANSWER-true
(T/F) the command [g++ -o student.cpp] invokes the compile stage but not the linking
stage of the compilation process - ANSWER-False - should be -c
(T/F) the keyword [virtual] is used to delay the binding of function call to definition so
that it's done at run time, instead of compile time - ANSWER-true
(T/F) the keyword virtual is used to delay the binding of the function call to definition so
that its done at run time, instead of compile time - ANSWER-true
(T/F) the shallow copy is sufficient for an object as long as the object does not have any
pointers or reference variables as member data - ANSWER-true
(T/F) the variable r can be directly used from inside a member function of class DDD -
ANSWER-false
(T/F) the variable w can be directly used from inside a member function of class BBB -
ANSWER-true
(T/F) when an array of objects is declared, the default constructor must be used to
initialize all of the objects - ANSWER-false
A binary operator overload written as a member function of a class will have one
parameter. - ANSWER-True
A constant object may only make calls to const member functions - ANSWER-True
A derived class constructor must always first call a constructor from its base class -
ANSWER-true
(T/F) A conversion constructor is a constructor that can be called with just one
parameter - ANSWER-True
(T/F) a derived class constructor will always first call its base class constructor -
ANSWER-true
(T/F) a protected member function of class X is accessible from class X and from any
class that X is derived from - ANSWER-false
(T/F) all arrays of type char are considered c-stye strings - ANSWER-false
(T/F) An R-Value is an expression that represents a modifiable storage location -
ANSWER-False
(T/F) cstring library functions, like strcpy, will protect the caller from overflowing array
boundaries on character arrays - ANSWER-false
(T/F) Every class has a default constructor - ANSWER-false
(T/F) Function calls are checked against their prototypes during the compiling stage of a
program build (not during the linking stage)_ - ANSWER-True
(T/F) If [Thing] is an abstract class, it is illegal to declare pointers of type [Thing*] -
ANSWER-False
(T/F) If a binary operator is overloaded and written as a member function of a class, the
function takes two parameters - ANSWER-False
(T/F) If a member data variable of a class is declared it be CONST, then its value is
fixed and is the same for all objects of that class type - ANSWER-False
(T/F) If class [C] is derived from class [P], a pointer of type [(C*)] can point to an object
of type [P] - ANSWER-false
(T/F) if class C is derived from class B, a pointer of type (C*) can point to an object of
type B - ANSWER-false (if said B* it would be true)
(T/F) if ptr is a pointer, then *ptr refers to the target of that pointer - ANSWER-true
(T/F) if the programmer doesn't write a copy constructor for a class, one will
automatically be created by the compiler - ANSWER-true
(T/F) if the programmer doesn't write the equality operator = for a class, one will
automatically be created by the compiler - ANSWER-false
, (T/F) if XXX is an abstract class, it is illegal to declare objects of type XXX - ANSWER-
true
(T/F) if XXX is an abstract class, it is illegal to declare objects of type XXX - ANSWER-
true
(T/F) In C++, a class can be derived directly from more than one base class -
ANSWER-true
(T/F) the automatic shallow copy is sufficient for an object as long as the object does
not have any arrays as member data - ANSWER-false
(T/F) the automatic shallow copy is sufficient for an object as long as the object does
not have any pointers or reference variables as member data - ANSWER-true
(T/F) the command [g++ -o student.cpp] invokes the compile stage but not the linking
stage of the compilation process - ANSWER-False - should be -c
(T/F) the keyword [virtual] is used to delay the binding of function call to definition so
that it's done at run time, instead of compile time - ANSWER-true
(T/F) the keyword virtual is used to delay the binding of the function call to definition so
that its done at run time, instead of compile time - ANSWER-true
(T/F) the shallow copy is sufficient for an object as long as the object does not have any
pointers or reference variables as member data - ANSWER-true
(T/F) the variable r can be directly used from inside a member function of class DDD -
ANSWER-false
(T/F) the variable w can be directly used from inside a member function of class BBB -
ANSWER-true
(T/F) when an array of objects is declared, the default constructor must be used to
initialize all of the objects - ANSWER-false
A binary operator overload written as a member function of a class will have one
parameter. - ANSWER-True
A constant object may only make calls to const member functions - ANSWER-True
A derived class constructor must always first call a constructor from its base class -
ANSWER-true