Question: Q Write a full code in C + + for the following requirements. A class, animal, with two data members to keep information on

Q\
Write a full code in C++ for the following requirements.
A class, animal, with two data members to keep information on the weight and age of the animal. Both members are private. The weight of the animal is a real number and age is an integer number.
Provide accessor and mutator functions for both data members.
Constructor and destructor functions to display messages on the screen when an object is created and destroyed.
In the main, ask the user to enter values for the data members and create an object of animal type with those input values.
Finally, show the details of the object on the screen.
All the member functions should be defined outside the class block.

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 Databases Questions!