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


What to Turn In

Notes Steps to Follow
  1. Follow the instructions in Getting Started with Visual J++ under "Creating a New Project."  Use Assignment7 as your project name.
  2. Follow the instructions under "Adding a New Class", but choose Class instead of ClassMain.  Name your class Checkerboard.
  3. Write in English the algorithm that you would use to complete this assignment.
  4. Take each part one at a time and convert that to Java.
  5. 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

Back to COMP 14