Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 11a 8 points Write a function named capitall that uses turtle graphics to draw a capital letter L that consists of just two lines.

image text in transcribed

Question 11a 8 points Write a function named capitall that uses turtle graphics to draw a capital letter L that consists of just two lines. The function capitalL takes two parameters: 1. t, a turtle that is used for drawing 2. width, the length of the short stroke of the L The height of a capital L is twice its width The function capitalL should draw a capital letter L beginning at the initial position and orientation of t, and should leave t with the same position and orientation on exit. Turtle t is initially at the point where the long and short strokes of the capital L touch and is oriented in the direction in which the short line of L should be drawn. Do not make any assumptions about the initial up/down state of the turtle Question 11b 12 points Write a function named Ls that uses turtle graphics and the function capitalL to draw a sequence of letter L's of specified size, position and orientation. Begin drawing each letter L at the same point, which is the initial location of the turtle. Increase the size of each letter L after the first L by a specified factor. Rotate each letter L after the first one clocKwlse by a specifled angle The function Ls should repeatedly call capitalL to draw the letter L's The function Ls takes 5 parameters: 1. t, a turtle used for drawing 2. initWidth, the length of the short side of the first lL 3. multiplier, the factor by which the size of successive L's is increased 4. reps, an integer that ls the number OT L'S to draw 5. angle, the number of degrees to rotate successive rectangles If Ls is called by the following code, this would be correct output import turtle s - turtle.Screen() aPen turtle. Turtle() aPen.left(60) Ls (aPen, 20, 1.5, 3, 20)

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_2

Step: 3

blur-text-image_3

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

Students also viewed these Databases questions