Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 11A (6 points) Write a function named midline that uses turtle graphics to dras a line of specified size. The function midline takes two

image text in transcribed
Question 11A (6 points) Write a function named midline that uses turtle graphics to dras a line of specified size. The function midline takes two parameters: 1. t, a turtle that is used to draw the line. The turtle t is initially in the middle of line to be drawn. This may be any location and orientation on the screen. The turtle t may initially be either up or down 2. lineLength, an integer that is the length of the line to be drawn The function midline should: 1. draw a line whose midpoint is the initial position of t 2. leave t in its initial position and orientation when it returns Question 11B (14 points) Write a function named spiral that uses turtle graphics and the function midline from Question 11a to draw a sequence of lines of increasing length. Each line is larger than the preceding one by a fixed multiplier. All the lines share a common midpoint. The function spiral takes five parameters 1. t, a turtle that is used to draw the spiral 2. length, an integer that is the length of the first line 3. multiplier, floating point number greater than 1.0 that is the ratio of the length of successive lines 4. numlines, a positive integer that is the number of lines to draw 5. angle, a positive integer that is the counterclockwise rotation between successive lines The function spiral should: 1. call the function midline repeatedly to draw a series of lines of increasing length with a common midpoint (the initial position of t) 2. rotate t counterclockwise after drawing each line For example, the following would be correct graphical output for the function call import turtle s turtle . Screen t = turtle . Turtle spiral(t, 50, 1.1, 15, 12

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

More Books

Students also viewed these Databases questions

Question

1. How does Kiwi Experience maintain a continual customer focus?

Answered: 1 week ago