Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The program asks for the radius of the largest circle, the bottom one. The inter

ID: 3705949 • Letter: T

Question

The program asks for the radius of the largest circle, the bottom one. The interaction should be as follows. draw_circle(): it draws a circle at a specified location with a given radius and color. It has the following parameters: a) x, the x coordinate of the point where the circle is to be placed b) y, the y coordinate of the point where the circle is to be placed c) radius, the radius of the circle in pixels draw_circle(): it draws a circle at a specified location with a given radius and color. It has the following parameters: a) x, the x coordinate of the point where the circle is to be placed b) y, the y coordinate of the point where the circle is to be placed c) radius, the radius of the circle in pixels following parameters d) color, the color to be used for drawing the circle e) fill, a Boolean which says whether the circle is to be filled. 2)draw_rectangle(): It draws a rectangle at a specified location with a given width, height and color. It has the following parameters.
f) x, the x coordinate of the point where the rectangle is to be placed g) y, the y coordinate of the point where the rectangle is to be placed h)width, the width of the rectangle in pixels I) height, the height of the rectangle in pixels j) color, the color to be used to filling the rectangle. 3) draw_snowman():Itusesdraw_circle()anddraw_rectangle()andpossiblysometurtle function calls to draw the snowman. It gets the radius of the bottommost circle as its only parameter. You should place the snowman in a reasonably visible part of the window.

The relative dimensions of the different parts of the snowman are as follows. As long as you are close to these dimensions and the snowman looks close to what is shown above, you will not lose points for size-related aspects. a) The center circle radius is 60% of that of the radius of the bottom circle. b) The top circle radius is 40% of that of the radius of the bottom circle. c) The width of the wider rectangle that forms part of the hat is equal to the diameter of the middle circle. The height of this rectangle is equal to 80% of the radius of the top circle. d) The width and height of the less wide rectangle that forms the part of the hat is equal to the diameter of the top circle e) The two eyes are circles filled in black color. Their radius is 5% of the radius of the bottom circle f) the length of the mouth is 20% of the radius of the bottom circle. Draw it as a rectangle with a height of one pixel. g) Have the hat stay just above the eyes; don’t have the eyes covered by the hat. PLEASE USE PYTHON 3.6
following parameters d) color, the color to be used for drawing the circle e) fill, a Boolean which says whether the circle is to be filled. 2)draw_rectangle(): It draws a rectangle at a specified location with a given width, height and color. It has the following parameters.
f) x, the x coordinate of the point where the rectangle is to be placed g) y, the y coordinate of the point where the rectangle is to be placed h)width, the width of the rectangle in pixels I) height, the height of the rectangle in pixels j) color, the color to be used to filling the rectangle. 3) draw_snowman():Itusesdraw_circle()anddraw_rectangle()andpossiblysometurtle function calls to draw the snowman. It gets the radius of the bottommost circle as its only parameter. You should place the snowman in a reasonably visible part of the window.

The relative dimensions of the different parts of the snowman are as follows. As long as you are close to these dimensions and the snowman looks close to what is shown above, you will not lose points for size-related aspects. a) The center circle radius is 60% of that of the radius of the bottom circle. The relative dimensions of the different parts of the snowman are as follows. As long as you are close to these dimensions and the snowman looks close to what is shown above, you will not lose points for size-related aspects. a) The center circle radius is 60% of that of the radius of the bottom circle. b) The top circle radius is 40% of that of the radius of the bottom circle. c) The width of the wider rectangle that forms part of the hat is equal to the diameter of the b) The top circle radius is 40% of that of the radius of the bottom circle. c) The width of the wider rectangle that forms part of the hat is equal to the diameter of the middle circle. The height of this rectangle is equal to 80% of the radius of the top circle. d) The width and height of the less wide rectangle that forms the part of the hat is equal to the diameter of the top circle e) The two eyes are circles filled in black color. Their radius is 5% of the radius of the bottom circle middle circle. The height of this rectangle is equal to 80% of the radius of the top circle. d) The width and height of the less wide rectangle that forms the part of the hat is equal to the diameter of the top circle e) The two eyes are circles filled in black color. Their radius is 5% of the radius of the bottom circle f) the length of the mouth is 20% of the radius of the bottom circle. Draw it as a rectangle with a height of one pixel. g) Have the hat stay just above the eyes; don’t have the eyes covered by the hat. PLEASE USE PYTHON 3.6
Enter the radius for the largest circle: 50

Explanation / Answer

import turtle import math screen = turtle.Screen() screen.bgcolor("blue") screen.title("Frosty the snowman!") frosty = turtle.Turtle() frosty.speed(0) frosty.color("black") frosty.fillcolor("white") frosty.pensize(3) frosty.hideturtle() # A function for drawing a face (eyes, mounth, nose) # by supplying the coordinate for the center of the eyes def Face(x,y): frosty.up() frosty.goto(x + 10,y) frosty.dot() frosty.goto(x - 10,y) frosty.dot() frosty.goto(x,y -10) frosty.dot() frosty.goto(x -15,y -25) frosty.down() frosty.forward(30) frosty.up() # A function for drawing a snowman arm with 2 fingers # by supplying the x,y coordinate # as well as the lenght of the arm and angle of the arm def Arm(x,y,length,heading): frosty.up() frosty.goto(x,y) frosty.setheading(heading) frosty.down() frosty.forward(length) frosty.setheading(heading + 20) frosty.forward(20) frosty.up() frosty.back(20) frosty.down() frosty.setheading(heading - 20) frosty.forward(20) frosty.up() frosty.home() # A function for drawing a circle by supplying the radius and y coordinate def Circle(radius,y): frosty.up() frosty.sety(y) # arc length = deg of arc * (pi/180) * radius arc_length = 1 * (math.pi/180) * radius frosty.down() frosty.begin_fill() #fill circle after it is drawn # itterate by making a bunch of little lines to form a circle for i in range(360): frosty.forward(arc_length) frosty.left(1) frosty.up() frosty.end_fill() # call all functions to create a snowman Circle(40,20) #head Circle(70,-120) #upper torso Circle(100,-320) #lower torse Arm(70,-50,50,20) #right arm Arm(-70,-50,50,160) #left arm Face(0,70) # the face screen.exitonclick()