Question: [ 2 0 pts ] Task 1 [ 1 5 pts ] Define a class ShapeManager to manage multiple shapes in a graphical window with
pts Task
pts Define a class ShapeManager to manage multiple shapes in a graphical window with the following attributes and methods:
Attributes:
shapes a list to store all shapes, eg circles, rectangleswin a GraphWin object to display the shapes
Methods:
addcirclecenter radius, color:
Add a circle to the shapes list with the specified center, radius, and color.
Draw the circle in the window.addrectanglebottomleft, topright, color:
Add a rectangle to the shapes list with the specified corners and color.
Draw the rectangle in the window.changecolorindex color:
Change the color of the shape at the given index in the shapes list.
Update its appearance in the window.deleteshapeindex:
Remove the shape at the given index from both the shapes list and the window.
pts Create a ShapeManager object and perform the following:
Create a GraphWin window with a title "Shape Manager" and dimensions x pixels.
Add a red circle with center and radius
Add a blue rectangle with bottomleft corner and topright corner
Add a green circle with center and radius
Expected Outcome:
Note: The background color does not have to be the same as the example below.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
