Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer 11B. Thank you. Please ANSWER 11B. Thank you. Question 11A (6 points) Write a function named tri that uses turtle graphics to draw

Please answer 11B. Thank you. image text in transcribedPlease ANSWER 11B. Thank you.

Question 11A (6 points) Write a function named tri that uses turtle graphics to draw three lines of equal length with a common point of origin. Each line should be rotated 120 degrees relative to the previous line The function tri takes two parameters 1) t, a turtle that is used for drawing 2) length, an integer that is the length of each line The turtle t is initially at the point of intersection of the three lines. The function tri should draw beginning at the turtle's initial location and orientation, and should exit with t in the same location and orientation. Do not make any assumptions about the initial up/down state of the turtle. For full credit you must use a loop for repeated operations. The following is correct sample input and output. import turtle s = turtle.screen() aTurt = turtle,Turtle() tri(aTurt,100) Question 11B (14 points) Write a function named tris that uses turtle graphics and the function tri in question 11A to draw a sequence of tri's of specified size and rotation. The function tris takes 5 parameters 1) t, a turtle used for drawing 2) initSize, the length of a line in the first tri 3) ratio, a floating point number greater than 1.0 that is the ratio of the length of the lines of successive tri's 4) rotation, the angle that each tri is rotated counterclockwise relative to the previous tri 5) num, the number of tri's to draw If tris is called by the following code, this would be correct graphical output. import turtle s = turtle . Screen() shelly turtle. Turtle() tris(shelly, 100, 1.2, 30, 4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago