CSCI 201 Spring 2003

Programming Project 3

In assignment 2 you wrote an Applet---a java program that runs in a browser window. In this assignment, you will modify that program as described in problem 4.9 on page 266 of your text. This is a somewhat complicated modification so we will be specific about the modifications. Here are the steps that you should follow in writing this program:


  1. Begin with the Quilt program that you wrote for assignment 2. If you were unable to correctly complete that program, feel free to begin with the example solution provided in this link. You will also need the accompanying HTML document. (Download these files by right-clicking on each link and selecting Save Target As from the pop-up menu.)


  2. We are going to begin by creating a new class that draws one patch of the Quilt. To create that class do the following:



  3. Rename Quilt.java to Checkerboard.java, both the class name and the file name. Also rename Quilt.html Checkerboard.html and change all internal references from Quilt to Checkerboard.


  4. Modify the code in Checkerboard.java to produce a quilt with a checkerboard pattern of patches similar to that shown below. The patches in the quilt must be created using the Pattern class created as described above. The checkerboard pattern should be created by varying both the number of circles and the color of the alternating patches as shown below; you may use any number of concentric circles and any colors you choose. You may also produce a quilt of any size you choose; you are not restricted to a 3x3 quilt as shown below.

Programming Style

Note that 10% of your program grade is based on the readability of your program. This includes things like proper indentation, comments, and the naming of variables and methods. To receive full credit for your program, make sure that you use proper indentation as demonstrated in your text and in class room examples. Also include a comment at the top of each program stating your name, the course, and the purpose of the program:

// Name: your name here // // Course: CSCI 201 // // Purpose: purpose of program here //

Submitting Your Program

The program written for this assignment must be turned in by transferring the java source code files and the HTML file to your ftp directory for this class. Both source code files (i.e., Pattern.java and Checkerboard.java) and the HTML file (Checkerboard.html) should be turned in and the files must have exactly those names. You were shown how to transfer files to your class ftp directory in lab 1