Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm exam 1 review Fall2006: Making Concentric Boxes

Back to Midterm Exam 1 Review Fall2006

Questions? Answers? Comments?




public class TurtleBoxes
{
public static void main(String[]Args)
{

Picture canvas = new Picture(500,500);
Turtle jenny = new Turtle(canvas);
for(int i = 0;i<4;i++)
{
jenny.forward(100);
jenny.turn(90);
}
for(int i = 0;i<4;i++)
{
jenny.forward(150);
jenny.turn(90);
}
for(int i = 0;i<4;i++)
{
jenny.forward(200);
jenny.turn(90);
}
canvas.show();
}
}

//REMOVED Cormack

can we use four turtle? just thinking about other ways, i prefer creating 4 turtles, well, the color will be different, but i think it is okay too.
Chris Ang



Link to this Page