Question: 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.. in Java, please do this recursively.. only the recursive code, dont worry
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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!