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

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

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

Arun Shankar answered on Nov 20 2021
149 Votes
Pet.cpp
#include "Pet.h"
// Default Constructor for the base class
Pet::Pet() {}
// Parameterize
d 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 "< cout<<"Neuter/Spayed: "<}
// 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