SlideShare a Scribd company logo
Suppose a zoo wants a C++ program to keep track of its animals
and to provide information for visitors. Suppose the following
class is the base class of an public inheritance hierarchy.
class Animal
{
public:
Animal( std::string &);
private:
std::string name; // The particular animal’s name
};
Animal::Animal( std::string & animaName) : name(
animalName) {}
Create a derived class that represents a specific group or family
of animals, and derive from that another class that represents an
even more specific family or an individual species. For
example, your classes could be
Bear
and
PolarBear
, or
Cat
and
Lion
. Each of your classes should publicly inherit from the next
larger class up the inheritance chain (e.g.
PolarBear
inherits from
Bear
and
Bear
inherits from
Animal.
) Each of your classes should contain a private
static
data member representing something that is true of all objects
of that class. (e.g. for
PolarBear
, it might be a Boolean
isWhite).
Post the C++ declaration of your two classes and show the
constructor code and the initialization of the static data
members.

More Related Content

More from simba35

Symbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docxSymbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docx
simba35
 
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docxSYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
simba35
 
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docxSynthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
simba35
 
Sustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docxSustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docx
simba35
 
Sustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docxSustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docx
simba35
 
Suppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docxSuppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docx
simba35
 
Supreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docxSupreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docx
simba35
 
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docxSuppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
simba35
 
Suppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docxSuppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docx
simba35
 
Suppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docxSuppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docx
simba35
 
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docxSuppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
simba35
 
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docxSuppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
simba35
 
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docxSupply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
simba35
 
Support your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docxSupport your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docx
simba35
 
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docxSummer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
simba35
 
Supply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docxSupply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docx
simba35
 
SummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docxSummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docx
simba35
 
Supported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docxSupported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docx
simba35
 
Summarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docxSummarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docx
simba35
 
SummaryView the following seven videos on You Tube, and write a .docx
SummaryView the following seven videos on You Tube, and write a .docxSummaryView the following seven videos on You Tube, and write a .docx
SummaryView the following seven videos on You Tube, and write a .docx
simba35
 

More from simba35 (20)

Symbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docxSymbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docx
 
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docxSYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
 
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docxSynthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
 
Sustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docxSustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docx
 
Sustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docxSustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docx
 
Suppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docxSuppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docx
 
Supreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docxSupreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docx
 
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docxSuppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
 
Suppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docxSuppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docx
 
Suppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docxSuppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docx
 
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docxSuppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
 
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docxSuppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
 
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docxSupply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
 
Support your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docxSupport your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docx
 
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docxSummer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
 
Supply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docxSupply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docx
 
SummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docxSummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docx
 
Supported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docxSupported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docx
 
Summarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docxSummarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docx
 
SummaryView the following seven videos on You Tube, and write a .docx
SummaryView the following seven videos on You Tube, and write a .docxSummaryView the following seven videos on You Tube, and write a .docx
SummaryView the following seven videos on You Tube, and write a .docx
 

Recently uploaded

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Suppose a zoo wants a C++ program to keep track of its animals and t.docx

  • 1. Suppose a zoo wants a C++ program to keep track of its animals and to provide information for visitors. Suppose the following class is the base class of an public inheritance hierarchy. class Animal { public: Animal( std::string &); private: std::string name; // The particular animal’s name }; Animal::Animal( std::string & animaName) : name( animalName) {} Create a derived class that represents a specific group or family of animals, and derive from that another class that represents an even more specific family or an individual species. For example, your classes could be Bear and PolarBear , or Cat and Lion . Each of your classes should publicly inherit from the next larger class up the inheritance chain (e.g. PolarBear inherits from Bear and Bear inherits from Animal. ) Each of your classes should contain a private
  • 2. static data member representing something that is true of all objects of that class. (e.g. for PolarBear , it might be a Boolean isWhite). Post the C++ declaration of your two classes and show the constructor code and the initialization of the static data members.