Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 11 Part A: 10 points A tick is a short line that is used to mark off units of distance along a line. Write
Question 11 Part A: 10 points A tick is a short line that is used to mark off units of distance along a line. Write a function named drawTick() that uses a turtle parameter to draw a single tick of specified length perpendicular to the initial orientation of the turtle. The function drawTick0 takes two parameters 1. a turtle, t, that is used to draw 2. an integer, tickLen, that is the length of the tick When drawTick() is called, t is in the location that the first tick should be drawn. (Hint: remembeir that the tick mark should be drawn perpendicular to the orientation that t is in when it is called.) You should not make any assumptions about the initial up/down state of t. On return from drawTicks(), t should be in the same location and have the same orientation that it had when it was called. Part B: 10 points Write a function named drawTicks) that calls drawTick) repeatedly to draw a set of parallel tick marks The function drawTicks) takes four parameters 1. a turtle, t, that is used to draw 2. an integer, tickLen, that is the length of the tick 3. an integer, numlicks, that is the number of ticks to draw 4. an integer, distance, that is the distance between parallel tick marks For example, the following would be correct output if drawTicks) were called by this code: importturtle s = turtle. Screen() turt = turtle . Turtle() drawTicks (turt, 5, 10, 15)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started