Computers and Technology

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 pen color should be changed to yellow before drawing a circle and the width of the pen to 5 pixels. 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*n*radius/120.0.
Fill in the circle with blue color. After drawing the circle, hide the turtle.
import turtle
import math
def drawCircle(centerpoint, radius):
degree = 3
count = 0
centerpoint = (2.0 * math. pi * radius / 120)
t. home()
t. setheading(degree)
while count <= 120:
t. down()
t. forward(2.0 * math. pi * radius / 120)
t. up()
degree += 3
t. setheading(degree)
count += 1
drawCircle(centerpoint, radius)

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:20, SundaeSunday
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given. b)the definition of max_balance should be removed since header files should not contain constants. c)the definition of cashregister should be removed since header files should not contain class definitions. d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
image
Computers and Technology, 24.06.2019 03:00, 2020IRodriguez385
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, hannahgracew12
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
image
Computers and Technology, 24.06.2019 14:00, ratpizza
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
Do you know the correct answer?
Define a function drawCircle.
This function should expect a Turtle object, the coordinates of...

Questions in other subjects: