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

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

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!