COMP 14-090 Summer I 2000
Assignment 7: A Checkerboard Applet
Assigned: Tuesday, June 20
Due: Thursday, June 22
Worth: 65 points
Description
Write an applet that draws an 8x8 red and black checkerboard. The
checkerboard itself should be 240x240 pixels. The background of the applet
should be white. When the user presses a mouse button in the applet, the
checkerboard should reverse itself (all the red squares turn black and all the
black squares turn red). You should use loops and conditionals in solving
this assignment.
You may work in pairs on this assignment. Each group only needs to turn in
one assignment, but make sure you have both person's names on the source code
and disk.
Hints
- Check out the Dots and RubberLines examples that we looked at in class
on Monday for examples of using MouseListener.
What to Turn In
- A printout of your Java source code.
- A disk with your Java source code (Checkerboard.java), bytecode
(Checkerboard.class), and an HTML file that will display your applet
(Checkerboard.html).
- An image of the applet. (You may include the output window image in the
same document as your memo instead of turning in a separate printout of
the output window.)
- A memo describing the problem and your solution of it. Include any
problems you encountered or comments you may have about the assignment. Also,
include an estimate of the total amount of time you spent working on this
assignment.
Notes
-
Don't forget to comment your program! If there are no comments, you will
lose at least 20% of the points.
-
Don't forget to virus check and label your disk according to the instructions
in Turning in Assignments on Disk.
-
Don't forget to sign the pledge on the printout of your source code.
- Extra Credit will be given for going above and beyond this
assignment. Note, to get extra credit, you must first complete this
assignment as written. Demos of extra credit work will be done in
class on Thursday.
- No late assignments will be accepted.
Steps to Follow
-
Follow the instructions in Getting Started with Visual
J++ under "Creating a New Project."
Use Assignment7 as your project name.
-
Follow the instructions under "Adding a New
Class", but choose Class instead of ClassMain. Name your
class Checkerboard.
-
Write in English the algorithm that you would use to complete this
assignment.
-
Take each part one at a time and convert that to Java.
- When running the program don't choose "Launch as console
application", but just take the default values.
| original checkerboard
| reversed checkerboard
|
|
|
Michele Clark
clark@cs.unc.edu