Question: Write a complete C++ program that defines, implements, and utilizes a Lion class and a Pine class. This lab practices the legacy code separation unique
Write a complete C++ program that defines, implements, and utilizes a Lion class and a Pine class. This lab practices the legacy code separation unique to C++, which splits the definition of classes from the implementation of classes. The program is made of five files: Lion.h, Lion.cpp, Pine.h, Pine.cpp, and TestLionPine.cpp The components of Lion class are defined in the Lion.h file; however, all constructors and methods should not have any implementation code in this header file. All implementation code i.e. constructor body and method body, should be written in Lion.cpp, which refers to the Lion.h using an include directive. The Lion class consists of following components. Properties (MUST be private) o weight: double o height: double e Constructors No-argument constructor: the constructor with no parameter Standard constructor: with the same number of parameters as properties o Methods o For each private property, create one get0 method and one set) method to provide reading and writing access to this property. Here, there should be two get0 methods and two set) methods. o toPrint0: no return. It prints out the names and current values of all properties. o eat0: no return, print with a complete sentence how this type of lionseat. For example, eat every 48 hours, eat meat only, or eat much more in rainy season. The methods should not have any implementation code in this header file. All implementation code i.e. constructor body and method body, should be written in Pine.cpp, which refers to the Pine h using an include directive. The Pine class consists of following components. components of Pine class a re defined in the Pine.h file; however, all constructors and Properties (MUST be private) o age: int o height: double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
