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...

Assume array items contains the integer values 0, 2, 4, 6 and 8. Which of the following uses the enhanced for loop to display each value in array items?

a. for (int i = 0; i < items.length; i++) System.out.prinf("%d%n", items[i]); b. for (int i : items) System.out.prinf("%d%n", items[i]); c. for (int i : items) System.out.prinf("%d%n", i); d. for (int i = 0 : items.length) System.out.prinf("%d%n", items[i]);

Computer Science & Information Technology

A(n) panel contains related commands, controls, and information about different aspects of working with Dreamweaver.

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

Computer Science & Information Technology

Web sites commonly have a(n) ________, which when clicked, link to another web page in the same Web site

Fill in the blank(s) with correct word

Computer Science & Information Technology

________ left by Internet and e-mail usage and digital devices may be the only way to collect enough evidence to solve a crime

Fill in the blank(s) with correct word

Computer Science & Information Technology