Multiple Choice
Given the following classes and code, what is the output of the last statement shown?
Class Pet
{
Public:
Virtual void print) ;
String name;
Private:
};
Class Dog: public Pet
{
Public:
Void print) ;
String breed;
};
Void Pet::print)
{
Cout << "My name is " << name;
}
Void Dog::print)
{
Pet::print) ;
Cout << ", and my breed is a "<< breed << endl;
}
Pet pPtr;
Dog dPtr;
DPtr->name= "Rover";
DPtr->breed="Weiner";
PPtr= dPtr;
PPtr->print) ;
A) My name is Rover, and my breed is a Weiner
B) My name is Rover
C) , and my breed is a Weiner
D) nothing
Correct Answer:

Verified
Correct Answer:
Verified
Q37: Given the following simplified classes,<br>Class Pet<br>{<br>Public:<br>Virtual void
Q38: A derived class automatically gets all the
Q39: If you have the following class definitions,
Q40: If the member variables in a base
Q41: If a base class has public member
Q43: Which of the following are not true<br>A)
Q44: An object of a derived class can
Q45: C++ implements polymorphism by waiting until run-time
Q46: The copy constructor from the base class
Q47: Which of the following are true?<br>A) constructors