Question: Lab: Classes and Shapes INSTRUCTIONS Rewrite the 2 d shape functions homework as a class. Write the square, rectangle and pentagon functions as classes Write

Lab: Classes and Shapes
INSTRUCTIONS
Rewrite the 2d shape functions homework as a class. Write the square, rectangle and pentagon functions as classes
Write the class square that takes x,y, angle, side and color as parameters (these are used in the __init__ method)
Write the method draw that will draw the square at location x,y, orientation angle, and size side, with the color color from the __init__ parameters using turtle graphics.
Instantiate the class.
Call the draw method
The result of the program's execution will be to draw a square of the specified color.
Write the class rectangle that takes x,y, w,h and color as parameters (these are used in the __init__ method)
Write the method draw that will draw the rectangle at location x,y, orientation angle, width w, height h and color color from the __init__ parameters using turtle graphics.
Instantiate the class.
Call the draw method
The result of the program's execution will be to a draw a rectangle of the specified color.
Write the class pentagon that takes x,y, angle, side and color as parameters (these are used in the __init__ method)
Write the method draw that will draw the equilateral triangle at location x,y, orientation angle, size side, and color color from the __init__ parameters using turtle graphics.
Instantiate the class.
Call the draw method
The result of the program's execution will be to draw a pentagon of the specified color.
Good descriptive comments are vital. No comments, no grade. There should be comments after every line in the first class and the complete problem description at the top. You need to explain what is happening in the program.
Attach your .py file to Blackboard. Don't forget the comments!
Attach a screen shot of the graphics output as well.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!