Question: When assigning a variable's value from the returned value of an overloaded function, the type declaration may be simplified to use the auto keyword. However,
When assigning a variable's value from the returned value of an overloaded function, the type declaration may be simplified to use the auto keyword. However, the auto keyword should not be used when the return type of the overloaded function is not already known.
Three shape objects: Triangle, Rectangle, and Pentagon, have private data members for side lengths integers the shape's respective constructors, accessors, and print functions. In main.cpp the overloaded resize functions should take one of a Triangle, Rectangle, or Pentagon object, resize the sides to a factor of a nonzero positive integer, and return a new shape object with the resized sides. Ex: A Triangle with side lengths and resized by a factor of should return a new Triangle with sides and respectively.
Implement the overloaded resize function for each shape.
resize takes in a shape object and a positive nonzero integer as the resize factor.
In each shape's implementation file, implement the shape's respective print function to output the shape's side lengths.
Ex: If a Triangle has side lengths and respectively, the output of printTri is:
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
