Create a World object and a Turtle object and use the Turtle object to draw a pyramid.

What will be an ideal response?

```
public void drawPyramid ( )
{
this . drawRectangle ( 1 0 0 , 5 0 ) ;
this . penUp ( ) ;
this . turnRight ( ) ;
this . forward ( 1 0 0 ) ;
this . penDown ( ) ;
this . turnLe f t ( ) ;
this . drawRectangle ( 1 0 0 , 5 0 ) ;
this . penUp ( ) ;
this . forward ( 5 0 ) ;
this . penDown ( ) ;
this . drawRectangle ( 1 0 0 , 5 0 ) ;
this . penUp ( ) ;
this . turnRight ( ) ;
this . forward ( 1 0 0 ) ;
this . turnRight ( ) ;
this . forward ( 5 0 ) ;
this . turn ( 1 8 0 ) ;
this . penDown ( ) ;
this . drawRectangle ( 1 0 0 , 5 0 ) ;
}
```

Computer Science & Information Technology

You might also like to view...

Explain how a program could use class string without inserting a using directive.

What will be an ideal response?

Computer Science & Information Technology

The ____________________ property for a control will automatically resize the control and place it in the same relative position on the screen regardless of monitor size and screen resolution.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology