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

  Compute the sum of the integers

Write a short code fragment that would compute the sum of the integers from 1 to 100 and leave this sum in $6. No input or output is necessary.

  Write pseudocode for a program

Write pseudocode for a program that prompts the user for a month and day and prints out whether it is one of the following four holidays.

  Program that translates a letter grade into a number grade

Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and F, possibly followed by + or -.

  Write a program to find that number for nguyen.

In some Asian countries, 8 and 6 are considered lucky digits. Any number containing only 8s and 6s is considered lucky number, e.g. 6, 8, 66, 668, 88, 886 .... Nguyen is a student who likes mathematics very much. Nguyen likes lucky numbers but only o..

  Create a script that uses case logic

Display the command(s) used to do the following: display the cclontents of .bashrc file. Next, use the vi editor to edit that file and put in an alias so that you see a long file listing of a directory every time you type list.

  In competitive tournament

In competitive tournaments, it is common for all the players or teams to play in a series of matches in order to determine a single winner of the entire tournament. However, a number of different tournament formats exist. Here, we will concern our..

  Uml diagram of all the classes

Speaking of converting into the correct object-type, the goal of the factory is to abstract away object creation.

  Calculate the number of elapsed days

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year imediately.

  Given a character code to indicate the type of customer

Pete's Plumbing of Pompey sells to both retail and wholesale buyers. The retail buyer must pay New York State and Onondaga County sales tax (8%). However, the wholesale buyer does not pay sales tax and receives a volume discount on the amount purchas..

  Write a for loop header that will count backwards

Write a statement to call a function named getAge that returns an integer and takes no parameters. Assign the returned value to the already declared variable child.

  Write a program that displays a weekly payroll report

Write a program that displays a weekly payroll report

  Problem on c++ tools

When working in teams (at most two students per team), send one solution file per team.

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