Posted: Monday, August 31.
Write a program that reads a number r from a user and then instructs a turtle to trace a circle of approximately this radius in the center of a window.
A turtle can't actually draw a curved line, but it can approximate the circle using an n-sided polygon, where each side is just one pixel long. Below is a 12-gon, and you can see that it is fairly close to a circle.

But if we want a circle whose radius is r pixels, how many 1-pixel sides do we need? To answer this question, we can reason from the polygon's perimeter. We can compute the perimeter directly as n, since we know there are n sides, each 1 pixel long. But we also know that the perimeter is closely approximated by the circle's circumference, 2 π r. Hence we conclude that the number of sides for the polygon n is roughly 2 π r.
Of course, 2 π r won't be an integer, but it won't hurt the picture if you draw an extra side or two, just to make sure you round the entire circle. For the below diagram, we suppose the user chose the radius to be 1, and so n turned out to be 6.28. But we actually draw 7 sides, turning 360/6.28 degrees each time. What we end up with still approximates the circle. It looks bad here, but that's only because it's been blown up several times. At actual scale, it looks fine.

The below program to draw a square using a while loop, is a particularly useful starting point for approaching this assignment.
public class DrawBox extends TurtleProgram {
public void run() {
double width;
width = this.readDouble();
Turtle boxTurtle;
boxTurtle = new Turtle(100 - width / 2, 100 - width / 2);
int drawn; // tracks how many sides are completed
drawn = 0;
while(drawn < 4) {
boxTurtle.forward(width); // draw a side
drawn = drawn + 1; // and update our count
boxTurtle.right(90);
}
boxTurtle.hide();
}
}