Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

=+How do the functions of HR vary with these various choices?

Answered: 1 week ago