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 d shape functions homework as a class. Write the square, rectangle and pentagon functions as classes
Write the class square that takes xy angle, side and color as parameters these are used in the init method
Write the method draw that will draw the square at location xy 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 xy wh and color as parameters these are used in the init method
Write the method draw that will draw the rectangle at location xy 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 xy 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 xy 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
