Question: create your own class. The class will be used to represent a fictional creature called a bloborb. Compared to humans these creatures age in a

create your own class. The class will be used to represent a fictional creature called a bloborb. Compared to humans these creatures age in a very odd way. The first year of life they age 10 years. The second year of life they age 5 years. Then every year that follows they age 3 years. Create a class named Bloborb. The class should have a data member that contains the age. The class should have two accessor methods for age: int getAgeCalenderYears - returns the age in calendar years int getAgeBloborbYears - returns the bloborb age in equivalent years to humans as described above The class should have a mutator method: void setAge(int calenderYears) - takes an integer input that is calendarYears to set the age. The data member that contains age should be dynamically allocated using the new keyword from within a constructor. The class should also have a destructor that frees the previously allocated memory. The class should also have a copy constructor that allocates a new age member to allow for a deep copy.

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!