Question: You are part of a team implementing a program that draws pictures composed out of simple shapes. You have a Shape class that will serve

You are part of a team implementing a program that draws pictures composed out of simple shapes. You have a Shape class that will serve as a base class: class Shape public: virtual void draw (GraphicsDevices device) const: You anticipate eventually adding multiple classes that inherit from Shape and that override draw(...) appropriately. For example, a LineSegment class would add two end points as data members and would implement draw(...) by drawing a line between the two endpoints. A Circle class would add a center point and a radius as data members and would implement draw(...) accordingly. Other shape subclasses are likely. One member of your team has suggested that an entire picture can be stored as a std:vector Shape">. Another team member has argued that the pointers are an unnecessary complication and suggested using a std:vectorcShape>. He has sketched the following code as a proof of concept: void drawPicture (const vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
