Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Textbook page 893, programming projects question 13 (class Pet)

1 answer below »
Textbook page 893, programming projects question 13 (class Pet)
Answered Same Day Nov 18, 2021

Solution

Arun Shankar answered on Nov 20 2021
146 Votes
Pet.cpp
#include "Pet.h"
Default Constructor for the base class
Pet::Pet() {}
Parameterized Constructor for the base class
Pet::Pet(string a) {name = a;}
Constructor for the Dog sub class
Dog::Dog(string a, bool b):Pet(a)
{
neuterSpayed = b;
}
void Dog::printDescription()
{
cout
"Dog named "
name
endl;
cout
"Neute
Spayed: "
neuterSpayed
endl;
}
Constructor for the Bird sub class
Bird::Bird(string a, bool b):Pet(a)
{
talks = b;
}
void Bird::printDescription()
{
cout
"Bird named...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here