Lab_01 - GCIS 501 Fall 2009 - Lab 1 Lab Dates: Aug 26...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
GCIS 501 Fall 2009 - Lab 1 Lab Dates: Aug 26 Grading Dates: In Class Summary In this lab exercise, you will write a program that will draw a figure in a window using a Turtle class. You should think about a solution before coming to lab. You will “create” a Lab01 project. You will write a Java solution in the appropriate style, and finally you will run and modify your program until your output matches the sample. Detailed instructions for dealing with the development environment are included starting on page 3 of this handout. Designing a Solution The Turtle class is included a package named Galapagos, and is modeled after Seymour Papert’s Logo. This turtle has a pen and when you move the turtle its pen will trace the movement. So, by moving a turtle object, you can draw many different kinds of geometrical shapes. For example, the following program commands a turtle to draw a square. You may want to use it as a starting point for your lab. /** * Program: DrawShape * File Name: DrawShape.java * Author: Yunkai Liu * Date: 08/26/09 * Description: Java application that uses an object from * the Turtle class to draw a square */ package Lab01; import java.awt.Color; import galapagos.*; public class DrawShape { public static void main (String[] args) { Turtle turtle = new Turtle(); // create turtle // draw a square with the turtle turtle.move(50); turtle.turn(90); turtle.move(50); turtle.turn(90); turtle.move(50); turtle.turn(90); turtle.move(50); } } 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Write a program that will draw the attached figure containing a blue square and two red, equilateral Triangles that are drawn to form a star. Your output should look pretty
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Lab_01 - GCIS 501 Fall 2009 - Lab 1 Lab Dates: Aug 26...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online