Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started