QuestionQuestion

1) Using C++ classes and virtual methods, organize the animals in a small zoo, having as guests lions, parrots, alligators, penguins, elephants, cobras, zebras, hawks, turkeys and rabbits.
Use at least 3 properties some of the animals might share and demonstrate overriding of their getter and setter methods.
Write 10 examples of method calls asking the inhabitants of the zoo to perform tasks to which they would answer back either "Doing it!" or "Sorry, I cannot do it".
**Must comment before beginning a function explaining what the underlying function is going to do*
**Program cannot come from internet sources**

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

#include <cstdlib>
#include "alligators.h"
#include "animal.h"
#include "cobras.h"
#include "elephants.h"
#include "hawks.h"
#include "lions.h"
#include "parrots.h"
#include "penguins.h"
#include "rabbits.h"
#include "turkeys.h"
#include "zebras.h"
using namespace std;

/*
*
*/
int main(int argc, char** argv) {

    // create 10 pointer
    //    in order to assign and all child class
    // we always use pointer
    animal * a[10];
    // assing the newly created object to pointers
    a[0] = new alligators("dark green",100,5);
    a[1] = new cobras("black yellow",6,3);
    a[2] = new elephants("grey",1000,8);
    a[3] = new hawks("brown",2,1);
    a[4] = new lions("yellow",500,3);
    a[5] = new parrots("green red yellow blue",1,1);
    a[6] = new penguins("black white", 2,2);
    a[7] = new rabbits("white pink", 2, 1);
    a[8] = new turkeys("black red",3,2);
    a[9] = new zebras("white black",90,3);
    ...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$33.25
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats