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


b. My name is Rover

Computer Science & Information Technology

You might also like to view...

What is used in order for TCP hosts to create a virtual connection with each other?

A. sliding window B. handshake process C. teardown sequence D. retry mechanism

Computer Science & Information Technology

The ________ property determines the size of the picture in the form

Fill in the blank(s) with correct word

Computer Science & Information Technology

________ is the default file type when saving a video in PowerPoint 2016

A) .wav B) .mp3 C) .avi D) .mp4

Computer Science & Information Technology

A PivotTable report starts with automatic updating each time that you open the workbook

Indicate whether the statement is true or false

Computer Science & Information Technology