Question: QUESTION 1 Write statements to define a class that includes the following. The class will not necessarily be complete - you only have to write
QUESTION
Write statements to define a class that includes the following.
The class will not necessarily be complete you only have to write the member functions that I ask for.
If any member function that you write calls another member function, you must write that function also.
You do not need to write a main function.
Define a class, Animal, with the following data members:
type
age
height
weight
Write a default constructor function for the class which will set the type to an empty string and the age, weight and height
Write a member function getExpectancy for the class that returns the life expectancy for the animal. The expectancy is
age, three times the height and two times the weight.
For the toolbar, press ALTFPC or ALTFNFMac
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
