Question: Write a class Diagram where a pointer shapes is used to maintain an array of Shape objects. In the constructor, shapes is newed as an
Write a class Diagram where a pointer shapes is used to maintain an array of Shape objects. In the constructor, shapes is newed as an array of two shape objects, one is a Rectangle object, and the other a Circle object. Try to write the destructor to delete shapes. Also, define a method draw to call the method draw of every element in the array pointed by shapes. Test your programs. Remember to draw UML
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
