Create a derived class that represents a specific group

Assignment Help C/C++ Programming
Reference no: EM13808037

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( string &nme );

private:

string name; // The particular animal's name

};

Animal::Animal( string &nme ) : name( nme ) {}

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 staticdata 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.

Reference no: EM13808037

Questions Cloud

Predicting the future of iran : Predicting the Future of Iran
Designing a grocery delivery business : You are designing a grocery delivery business. Via the internet, your company will offer staples and frozen foods in a large metropolitan area and then deliver them within a customer-defined window of time.
Explain which ideas you most agree with from the critiques : Now that you have studied multiple ethical theories, explain which ideas you most agree with from these critiques and which you believe to be weaker than the others.
Plan to transform the organization : Think of an organization you have worked for or one with which you are very familiar.  Diagnose the need for change and present a plan to transform the organization, utilizing Kotter's 8-Step Approach.
Create a derived class that represents a specific group : 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
Undermine a project in several ways : Scope Creep is something that can undermine a project in several ways. Can scope creep make it difficult for the contractor to keep costs under control? Why or why not? And, can the schedule suffer due to all of the added work?
Write an toulmin essay on students in public school : Write an Toulmin essay on STUDENTS IN PUBLIC SCHOOL SHOULD WEAR SCHOOL UNIFORMS
Subordinate teams and oversight of subordinate plans : A(n) ____ is the collection of individuals responsible for the overall planning and development of the contingency planning process, including the organization of subordinate teams and oversight of subordinate plans.
Explain how given play illustrates the theme of given poem : Write an essay in which you explain how the play illustrates the theme of the poem. Discuss specifically the different characters and their dreams in relation to the two works

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Ruby implement primitive types

How does Ruby implement primitive types, such as those for integer and floating-point data?  3-What is the single most important practical difference between Smalltalk and C++?

  Need a program that has the user enter a string

Need a program that has the user enter a string. The program will test to see if its a exact palindrome like "civic" or "level". then it should test if its an inexact palindrome like "a nut for a jar of tuna".

  For this program reads the first 11 characters

E main for this program reads the first 11 characters from input, saving them. It then reads 26 short integers into |vals|, and passes them and the characters to EmbedWatermark, which subtly alters the contents of vals to contain the characters. A..

  Create a friend class

Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an array of Friend as well as the owner's name and cell phone Number.

  Include a main function that will solicit

Include a main function that will solicit a DNA sequence string from the user, call the genes function to obtain all the genes in the sequence and print each one on the console display

  Implement function types that takes no input

Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double.

  Squares, triangles, circles and ellipses

write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner ( S L L x , S L L y ), and the length of one side  S W .

  Questionnbspnbspi have a product called neverwet that

questionnbspnbspi have a product called neverwet that creates a hydrophobic surface on stuff. theres a base and top

  Declare a 1-dimensional array of integers

In pseudocode and in C code, declare a 1-dimensional array of Integers called InternetHits that will hold up to 10 Integer values representing the number of hits a Web site receives.

  Write a program that reads a list of integer

Write a program that reads a list of integer and stores the integers in an array and write a function compact that eliminates all zeroes from its array parameter

  Program which opens a data file and displays its content

writing a C++ program which opens a data file and then displays its contents with line numbers. That is the program should display the number 1 and then the first line of the file, then the number 2 and the second line of the file, etc.

  Accept positive and negative numbers in its input sequence

the program must accept positive and negative numbers in its input sequence, and ?nd the largest and smallestof the numbers entered whether they are all positive, all negative, or a combination of both positive and negative.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd