1. We have already found a variant expression and threshold for Conditions 1 and 2, showing that randomFractal does not result in infinite recursion. For Condition 3, we must show that the method has...


1. We have already found a variant expression and threshold for Conditions 1 and 2, showing that randomFractal does not result in infinite recursion. For Condition 3, we must show that the method has correct behavior for the stopping case. In this case, (rightX - leftX) is no more than STOP, and therefore the line segment does not need further dividing. We only need to draw the current line segment, which is what the method does. In Condition 4 of the inductive reasoning, we assume that the two recursive calls correctly generate a random fractal for the two smaller line segments we have created. Putting these two smaller random fractals together correctly gives us the larger random fractal.





Dec 07, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here