Comp 272 Program 4 Dordal Due: April 2, 2001 For your fourth program you are to take Horstman's shapes.cpp file, available on my web page, and do the following: * Add a Group shape, consisting of a list of other shapes. * Add a ColoredGroup shape, derived from Group, which draws the group in a given color, and then restores the previous color. ColoredGroup should have color() and setcolor() operations. * Get clone() to work for all the shapes. It works for some now; for others it only returns 0. * Define a new class derived from ColoredGroup (or Group). Provide a ctor. Your shape should be something more complex than a Polygon. Here are a few possibilities: Tree (oval top, rectangle trunk) wagon (rectangle body, two circular wheels) car (polygonal body, wheels) bird (two polygons, or else one polygon with a circular eye) house (compound polygon) * Draw a simple picture using your group, and replicate it all around the screen. Your drawing should include at least two colors, and also some move and scale operations. You will need Horstmann's graphics.cpp and graphics.h (and setup.h) to get shapes.cpp to compile. Do *not* change these auxiliary files; I will expect your program to compile with the versions of setup.h and graphics.* provided on my web page. All your changes should be to shapes.cpp. Note that there is no shapes.h. When you copy these files, you will need to create a new project. The project must be a "Win32 Application", *not* a "Console Application". You will define your three classes, and implement them, and then put all the drawing specifications into the final paint() function. Note that there is no main() function in shapes.cpp. Group: A Group has within it the following private data: vector _shapelist(); You need to support the operations plot(), move(), scale(), and clone() on Groups. To do these, you just go through the Shapelist and call the respective operation on each individual component. For clone you will first have to create the new _shapelist. Group will have one new operation: add(Shape * s). You'll implement this with _shapelist.push_back(s); _shapelist will thus be initially empty. There is no delete operation, and no mechanism to extract the Nth shape. Note that components can themselves be Groups. Note also that shapes put into a Group will have to be created dynamically: Group g(); g.add(new Star(center, 50)); g.add(new Circle(center, 50)); To get everything to compile, you will also need to provide read() and print() operations; these can be dummies with empty bodies: {} Email me *only* the shapes.cpp file. I've provided it online with a paint() function that calls facedraw(). Delete that call from your program.