Thank you for sending this in! Andrew's solution:
Math.round( x * 100) / 100.0
Is what we expect from students here. Do you feel that it is reasonable that your students come to this solution on their own, or is additional instruction needed to get them there?
Beth, I took a look at your program. In the optimal solution, a
for loop is used, with an incrementing variable named
i. In your solution, and
while loop is used, that terminates when your
angle variable reached
2*Math.PI. At the beginning of your loop, you call
Math.round(angle * 100)/100. The
for loop in the optimal solution is always using the unrounded value of
i. Because the rest of the values are calculated from that value (
i for the optimal solution,
angle for your program) the rounding is causing the slight changes between the values that your program produces, and the value that the autograder is expecting. Does that help? Let me know if any more questions arise on this exercise.