Solved

Given the Following Simplified Classes

Question 53

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents