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

  Define a static method samecolor in the car class

Write an abstract class Car to implement the Comparable interface. Write a Truck class and a Sedan class to implement Car. define a static method sameColor in the Car class to find out weather a Truck and a Sedan has the same color.

  Implement the readlog function

Implement the readLog function below, which is to (1) read the file, (2) populate a vector for each column, and (3) return the number of lines found.

  Define the cheetah constructor to accept and initialize

Design and implement a class called Cheetah that contains instance data that represents the cheetah's name, age, weight, length and gender.

  Write a program to calculate existing angles and do if and

write a program to calculate existing angles and do if and then from this and to place fixed angles at certain position

  Program specifications for a simple business problem

Given a set of program specifications for a simple business problem utilizing a modular design, code and test a program that meets the specifications and employs best programming practices.

  Write c program to find smallest-largest values

Write a program c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

  Calculate the component voltages

Calculate the component voltages for the following series resonant RLC circuit

  Design a phonecall class that holds a phone number

Design a PhoneCall class that holds a phone number to which a call is placed, the length of the call in minutes, and the rate charged per minute. Overload extraction and insertion operators for the class.

  Build a method for performing frequency analysis

Build a basic cipher base class that may be derived from for the ciphers and decode a Caesar Cipher text. You will have two cases.

  Write a program code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  What is the bug or logic error in the above program

What is the bug or logic error in the above program. Add the lines to fix it. This is an example of __nested__________ loops. How many times does the outer loop execute

  Prepare a program to print the permutation

write a program to print the permutation that lexicographically precedes the given input permutation. If the given permutation is the lexicographically least permutation, then print the input permutation itself.

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