Question: you will demonstrate that you can create a repetitive turtle graphics program that responds correctly to user input. This will include following proper naming,
you will demonstrate that you can create a repetitive turtle graphics program that responds correctly to user input. This will include following proper naming, formatting and style conventions. Description: Programs often depend upon user input. Create a turtle graphics program that draws either a square or a triangle based upon the end user's input. The program will display the turtle's state at each corner to the console. Then repeat the user prompts to allow the user to specify another shape and draw it correctly. Assignment: Create a turtle graphics Python program that performs the following: o Asks the user whether they want to draw a square or a triangle Then asks the user how long they want the sides to be o o Draws the requested shape on the screen (See Figure I below for an example) o Reports the X and Y coordinates and the turtle's heading after the turn for each corner to the console (See Table 1 below for an example) Helpful tip: The turtle will report the X and Y coordinates using decimals, use the format() function to display as integer values o Repeats the above steps to allow the user to specify a second shape to draw o The drawing window should be a color not used in the other drawing elements o The drawing window should have an appropriate title > Upload your .PY code file to the appropriate Blackboard assignment Figure 1- Example Drawing What do you want me to draw? (1 square, 2 triangle): 1 I will draw a square. 150, 8 and my heading is 90.0 How long do you want the sides of your square to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: My 2nd corner is at: My 3rd corner is at: My 4th corner is at: 150, 300 and my heading is 180.0 -158, 398 and my heading is 270.0 -150, e and my heading is 0.0 What do you want me to draw? (1 square, 2 triangle): 2 I will draw an equilateral triangle. How long do you want the sides of your triangle to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: 150,-e and my heading is 120.0 My 2nd corner is at: e, 260 and my heading is 240.0 My 3rd corner is at -150, e and my heading is 0.0 Table 2-Example Interaction and Output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
