Multiple Choice
Given the following simplified classes,
Class Pet
{
Public:
Virtual void print) ;
String name;
Private:
};
Class Dog: public Pet
{
Public:
Void print) ;
String breed;
};
Dog vDog;
Pet vPet;
VDog.name="rover";
VDog.breed = "Collie";
Which of the following statements are not legal?
A) vPet=vDog; cout << vDog.name;
B) vPet=vDog; cout << vDog.breed;
C) vPet=vDog; cout << vPet.name;
D) vPet=vDog; cout << vPet.breed;
Correct Answer:

Verified
Correct Answer:
Verified
Q32: The assignment operator is inherited from the
Q33: In order to tell the compiler to
Q34: The ifstream class is derived from the
Q35: When the derived class gets all the
Q36: If two functions in the same scope)
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
Q42: Given the following classes and code, what