Solved

Given the Following Simplified Classes

Question 37

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions