/** * Class for creating a template for a simple Java program * * @author Pat Troy: troy AT uic DOT edu */ // import the library with the color information import java.awt.Color; // Note the name of the class in the following line MUST // match the name of the file. This is stored in a file // named: Template.java public class Lect99d { public static void main (String[] args) { System.out.println("Begin Java Exection"); System.out.println(""); // Create a world for the turtle World w = new World(); // Create the turlte and place it in the world Turtle t = new Turtle (w); // draw a rectanlge on the world with the turtle t.setPenWidth(5); t.forward (100); t.turn (90); t.forward (200); t.turn (90); t.forward (100); t.turn (90); t.forward (200); // draw a sqaure on the world with the turtle t.penUp( ); t.forward (150); t.penDown () ; t.setPenColor (Color.blue); t.forward (75); t.turn (90); t.forward (75); t.setPenColor (Color.red); t.turn (90); t.forward (75); t.turn (90); t.forward (75); t.turn (90); // display the world w.show(); System.out.println(""); System.out.println("End Java Exection"); } } // end of Template class