Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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& pic, GraphicsDevice & gd) for (int -0 . 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& pic, GraphicsDevice & gd) for (int -0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started