COP3330 Exam Questions with
Answers 100% Pass
if cptr is a pointer to an object of type Cow, then the notation cptr->Moo( ); is
equivalent to which of the following:
a. *cptr.Moo( );
b. *cptr->Moo( );
c. (*cptr).Moo( );
d. cptr[0]->Moo( ); - CORRECT ANSWER-c
if a member function of class Player is protected, this means it is accessible from:
a. within class Player and any class derived from Player
b. inside class Player only
c. within class Player and any class that Player is derived from
d. anywhere - CORRECT ANSWER-a
which of the following is a correct prototype for the assignment operate overload
member function in a class called Button?
a. Button& operator= (Button &, const Button &);
,b. Button& operator= (const Button &);
c. Button (const Button &);
d. Button = (Button &); - CORRECT ANSWER-b
a function in a derived class that has the same prototype as a function in its base
class is said to _____ the base class function.
a. inherit
b. eliminate
c. override
d. overload - CORRECT ANSWER-c
given a pointer declared as monkey* barrel; (where monkey is a class). How does
one dynamically allocate an array of 25 monkey objects?
a. new monkey[25] = barrel;
b. barrel = new monkey barrel [25];
c. monkey = new barrel [25];
d. barrel = new monkey[25]; - CORRECT ANSWER-d
which of the following statements correctly de-allocated the dynamic array created
in the last question?
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED
, a. delete [ ] barrel;
b. delete [ ] monkey;
c. delete *barrel;
'd. ~monkey( ); - CORRECT ANSWER-a
from inside a member function, the keyword this is...
a. a pointer to a parameter of the function
b. the name of the calling object
c. a reference variable to the member function
d. a pointer to the calling object - CORRECT ANSWER-d
for which of the following situations is a copy constructor invoked?
a. when an object is returned from a function by reference
b. when an object is passed into a function by value
c. when a pointer to an object is passed into a function
d. when an object is passed into a function by const reference - CORRECT
ANSWER-b
given the declaration: int* ptr; which of the following CANNOT be assigned into
ptr?
a. the value of the iptr, a pointer to int
Answers 100% Pass
if cptr is a pointer to an object of type Cow, then the notation cptr->Moo( ); is
equivalent to which of the following:
a. *cptr.Moo( );
b. *cptr->Moo( );
c. (*cptr).Moo( );
d. cptr[0]->Moo( ); - CORRECT ANSWER-c
if a member function of class Player is protected, this means it is accessible from:
a. within class Player and any class derived from Player
b. inside class Player only
c. within class Player and any class that Player is derived from
d. anywhere - CORRECT ANSWER-a
which of the following is a correct prototype for the assignment operate overload
member function in a class called Button?
a. Button& operator= (Button &, const Button &);
,b. Button& operator= (const Button &);
c. Button (const Button &);
d. Button = (Button &); - CORRECT ANSWER-b
a function in a derived class that has the same prototype as a function in its base
class is said to _____ the base class function.
a. inherit
b. eliminate
c. override
d. overload - CORRECT ANSWER-c
given a pointer declared as monkey* barrel; (where monkey is a class). How does
one dynamically allocate an array of 25 monkey objects?
a. new monkey[25] = barrel;
b. barrel = new monkey barrel [25];
c. monkey = new barrel [25];
d. barrel = new monkey[25]; - CORRECT ANSWER-d
which of the following statements correctly de-allocated the dynamic array created
in the last question?
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED
, a. delete [ ] barrel;
b. delete [ ] monkey;
c. delete *barrel;
'd. ~monkey( ); - CORRECT ANSWER-a
from inside a member function, the keyword this is...
a. a pointer to a parameter of the function
b. the name of the calling object
c. a reference variable to the member function
d. a pointer to the calling object - CORRECT ANSWER-d
for which of the following situations is a copy constructor invoked?
a. when an object is returned from a function by reference
b. when an object is passed into a function by value
c. when a pointer to an object is passed into a function
d. when an object is passed into a function by const reference - CORRECT
ANSWER-b
given the declaration: int* ptr; which of the following CANNOT be assigned into
ptr?
a. the value of the iptr, a pointer to int