1 #Write your program below: 2 import turtle 3 import math 4 5 def drawCircle(turtleobj, x, y, radius): distance = 2.0*math.pi* (radius/120.0) turtleobj.penup() turtleobj.setposition(x,y)...


The photos included are the question and the code I wrote so far. The terminal says that the circle produced is too high and needs to come down. I do not know how to reposition the circle. Please help.


Python 3


1 #Write your program below:<br>2 import turtle<br>3 import math<br>4<br>5 def drawCircle(turtleobj, x, y, radius):<br>distance = 2.0*math.pi* (radius/120.0)<br>turtleobj.penup()<br>turtleobj.setposition(x,y)<br>turtleobj.pendown ()<br>10<br>for k in range(0,150):<br>11<br>turtleobj.fd(distance)<br>12<br>turtleobj.left(3)<br>13<br>14<br>15 def main():<br>16<br>X = 50<br>17<br>y = 75<br>18<br>radius = 100<br>19<br>turtleobj<br>= turtle. Turtle()<br>drawcircle(turtleobj,x,y,radius)<br>20<br>21 if<br>name<br>main':<br>22<br>23<br>main()<br>24<br>turtle.mainloop()<br>

Extracted text: 1 #Write your program below: 2 import turtle 3 import math 4 5 def drawCircle(turtleobj, x, y, radius): distance = 2.0*math.pi* (radius/120.0) turtleobj.penup() turtleobj.setposition(x,y) turtleobj.pendown () 10 for k in range(0,150): 11 turtleobj.fd(distance) 12 turtleobj.left(3) 13 14 15 def main(): 16 X = 50 17 y = 75 18 radius = 100 19 turtleobj = turtle. Turtle() drawcircle(turtleobj,x,y,radius) 20 21 if name main': 22 23 main() 24 turtle.mainloop()
Define a function drawCircle . This function should expect a Turtle object, the coordinates of<br>the circle's center point, and the circle's radius as arguments. The function should draw the<br>specified circle. The algorithm should draw the circle's circumference by turning 3 degrees and<br>moving a given distance 120 times. Calculate the distance moved with the formula 2.0 x n x<br>radius 120.0.<br>Define a function main that will draw a circle with the following parameters when the program<br>is run:<br>• X = 50<br>• Y = 75<br>Radius = 100<br>

Extracted text: Define a function drawCircle . This function should expect a Turtle object, the coordinates of the circle's center point, and the circle's radius as arguments. The function should draw the specified circle. The algorithm should draw the circle's circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 x n x radius 120.0. Define a function main that will draw a circle with the following parameters when the program is run: • X = 50 • Y = 75 Radius = 100

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here