COP 3330 Myers Test 2 Exam with
complete solutions latest version
If tList is an array of pointers to objects of type Turkey, then which of the following is a
syntactically correct call to the Gobble() function of the Turkey class? - CORRECT
ANSWER-tList[0]->Gobble();
Which of the following functions must always exist for a class? (i.e. if you do not create
one, the compiler will create on automatically) - CORRECT ANSWER-copy constructor
Which of the following is a correct prototype for the assignment operator overload
member function in a class called Chart? - CORRECT ANSWER-Chart&
operator=(const Chart&);
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 - CORRECT ANSWER-override
Given a pointer declared as game* collection; (where game is a class). How does one
dynamically allocate an array of 20 game objects? - CORRECT ANSWER-collection =
new game[20];
Which of the following statements de-allocates the dynamic array created in the last
question?
A. delete *collection;
B. delete [] collection;
C. delete [] game;
D. ~game(); - CORRECT ANSWER-delete [] collection;
From inside a member function, which of the following represents the address of the
calling object?
A. this
BRAINSCAPE1