Question: Copy and paste the Dog class defined below into the Canvas editor. Update the Dog class to be an abstract base class.Do not add any

  1. Copy and paste the Dog class defined below into the Canvas editor. Update the Dog class to be an abstract base class.Do not add any new member variables or functions to the Dog class.

  1. Define a class named Poodle that is derived from the Dog class.All code should be written inline in the Poodle class definition.
  2. Define the Poodle class to inherit from the Dog class with public access.
  3. The Poodle class should have one constructor that has parameters for name, breed, weight, and age. The Poodle constructor must pass the parameter values directly to the Dog class constructor. The Poodle constructor does not do anything else.
  4. The Poodle class must override the bark member function from the Dog class.

  1. Create a Poodle instance using the derived Poodle class:
  2. Note: it is not necessary to write a main function for the following steps. You only need to write the statements that would instantiate a Poodle object in the main function.
  3. Write the line of code that would be necessary to create a Dog class pointer variable in the main function.
  4. Using the Dog class pointer variable in the previous step, write the line of code that would dynamically allocate a poodle instance and assign it to the Dog pointer variable in the main function.

classDog

{

private:

stringname_;

stringbreed_;

intweight_;

intage_;

public:

Dog(stringname,stringbreed,intweight,intage)

{

name_=name;

breed_=breed;

weight_=weight;

age_=age;

}

voidbark();

};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!