Write a complete C++ program that creates an Alligator class and uses objects of this class. The
Question:
Write a complete C++ program that creates an Alligator class and uses objects of this class. The Alligator class consists of following components.
Properties (using public access modifier):
weight: double
num_leg: int
age: double
Constructors:
Blank (no-argument) constructor: the constructor that has no parameter
Standard constructor: the constructor with the same number of parameters as properties.
Methods:
to Print(): no return, print the name and current value of every property.
swim(): no return, describe how the alligator swims using an output statement, for example, it swim slowly after a meal.
The main() function should be placed below the Alligator class, inside the same source file as the Alligator class.
In the main() function, do the following actions:
Create two Alligator objects, one from the no-argument constructor, and another from the standard constructor.
For the latter object from the standard constructor, a value should be read from the user with proper prompts for every property. At the end, call every method from each object.
For both objects, change every property's value using assignment statements, with values read from the user. Call every method from each object one more time.
Introduction to Operations Research
ISBN: 978-1259162985
10th edition
Authors: Frederick S. Hillier, Gerald J. Lieberman