SlideShare a Scribd company logo
1 of 2
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.docxsimba35
 
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.docxsimba35
 
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..docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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 .docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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 .docxsimba35
 
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.docxsimba35
 
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.docxsimba35
 
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 .docxsimba35
 

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

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

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.