Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Java, please do this recursively.. only the recursive code, dont worry about the turtle package... Create a recursive function w(length, step) that takes the
in Java, please do this recursively..
only the recursive code, dont worry about the turtle package...
Create a recursive function w(length, step) that takes the length of the longest side of a 'w' and the distance each side reduces step as parameters and recursively draws a w shape. The angle to turn is 120. Each side must be at least step pixels long. After drawing the 'w', you will need to pick up the pen and go back twice the length to get back to the beginning. Test your function by drawing at least two w's with different parameters: W HR III ZH M TANINMIT TITITITI TIL TI 7 w(50, 10) w(100, 5) Hint: Draw a single 'w' first and check your turtle is at the proper angle to continue before adding in the recursion 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