See CMS for deadline
This assignment introduces you to graphics. You will write procedures that draw interesting designs,
bouncing balls, and a recursive design in a JFrame. You may work with one other person. If you do so,
form your group on the CMS WELL BEFORE YOU SUBMIT YOUR FILES. Remember, partners should
work together and not independently.
You need not use a JUnit testing class. You will (partly) be looking at visual output (graphics) to determine
Please keep track of the time you spend on this assignment. You will be asked to put it in a comment at the
top of file A5.java.
To save time and effort, we give you complete specifications of most of the methods you write. Please study
them carefully. Note how precise and thorough they are. You should aim for this quality of specification
when you write your own specifications. At the end of this document, we tell you what to submit.
, unzip it, and put everything in it into a new directory. It contains:
1. A file
, which extends class
2. Several .class files. These are machine language versions of .java files. Do NOT load them
into DrJava. The only thing you should load into DrJava is file
. It will automatically
use the .class files.
3. A directory
, which contains specifications of class
. You will use these specs
when writing method calls to make turtles do what you want.
is a pen of a certain color at a pixel
that is pointing in some direction given by an angle (0
degrees is to the right, or east; 90 degrees, north; 180 degrees, west; and 270 degrees, south). When the
turtle is moved to another spot using procedure
, a line is drawn if its pen is
currently "down" and nothing is drawn if its pen is "up". The pen is initially black, but its color, of class
, can be changed. A footnote on page 1.5 of the ProgramLive CD contains information
in your favorite browser and study the specifications of methods in class
(the javadoc files). Here are some important points:
object that is attached to a
. It builds on class
maintaining the "turtle", which has a position and an angle and holds a pen of a color; the pen is up
or down. You can use many turtles at the same time; they all use the same
The coordinates and angle of the turtle are maintained using type
This is needed for
maximum accuracy. If we used
, errors might crop up after many calculations. However, whenever
a point is to be placed in the window, its x- and y-coordinates are rounded to the nearest integer
because the graphics space works with