Examlex

Solved

Given the Following Classes and Code, What Is the Output

question 9

Multiple Choice

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) ;


Definitions:

Collection Agencies

Companies that pursue the collection of debts on behalf of creditors.

Licensed

Having officially received permission from the relevant authorities to perform, conduct, or carry out a particular activity or service.

Sodium Hydroxide

A highly caustic metallic base and alkali salt commonly used in manufacturing and as a chemical reactant.

Sulphuric Acid

A highly corrosive strong mineral acid with the molecular formula H2SO4, used in various industrial processes.

Related Questions