Question: Part 1 - Abstract Classes 1-1 Define and implement a class named animal that has the following constructor and attributes: animal(string n, int v)1/creates an



Part 1 - Abstract Classes 1-1 Define and implement a class named animal that has the following constructor and attributes: animal(string n, int v)1/creates an animal with name n and body volume v. /I animals are allocated a unique ID on creation // the animal's name // the animal's unique ID // the volume of the animal's body string name int animaLID int volume; Following the principles of encapsulation and information hiding, set the proper access modifiers for the attributes and provide methods to access the object's data. You need to set the name and volume of an animal, as well as getthe animal's name, animallD and volume. There must not be a set function for animallD. The get and set function names should be the attribute name prefixed with "get_" or "set_" respectively. For example, the get and setmethods for volume would be named get_volume and set_volume respectively. Declare the get_name function as pure virtual. When selecting between the three types of access modifiers for each of the attributes, note that none of the attributes may be public but, in the further questions child classes of animal are to be implemented that will need to directly access the attributes name and animalID
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
