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=new Dog;
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

a. My name is Rover, and my breed is a Weiner

Computer Science & Information Technology

You might also like to view...

When customizing the Windows 10 Start menu, the easiest way to add an app is to ________

A) right-click the app and access the shortcut menu B) turn the Live Tile off C) double-click an app that is located on the taskbar D) drag an app that is located on the taskbar to the Start menu

Computer Science & Information Technology

It is not possible to encrypt a Windows hard drive volume.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology