Write a method for Turtle to draw a hexagon. Pass in the length of the sides.

What will be an ideal response?


public void drawHexagon ( int width )
{
this . turn ( 3 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
this . forward ( width ) ;
this . turn ( 6 0 ) ;
}

Computer Science & Information Technology

You might also like to view...

The Word Proofing dialog box displays the number of pages, words, characters, paragraphs, and lines

Indicate whether the statement is true or false

Computer Science & Information Technology

An additional benefit of macros is increased usability from the end-user's point of view

Indicate whether the statement is true or false

Computer Science & Information Technology

Whenever you use a network to transfer data, an entire set of ____________________ is used to set up and maintain reliable data transfer between the two network stations.

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

Computer Science & Information Technology

Using parity, the probability for detecting an error, given that one has occurred, is:

a. about 50% for either even or odd parity b. about 70% for even parity and 30% for odd parity c. about 30% for even parity and 70% for odd parity d. about 0% for either even or odd parity e. about 100% for either even or odd parity

Computer Science & Information Technology