CSCI 201 Spring 2003
Programming Project 2
In lab
4 you learned how to write an Applet---a java program that runs in
a browser window. As your second programming project, you will work
problem 3.25 in your text in which you will write an Applet.
Problem 3.25 tells you to create a quilt of your own design, but we
are going to be more specific. Here are the steps that you should
follow in writing this program:
- Begin with the Bullseye program (example 3.18) from your text.
You can get that program from this link or
from the homepage for
your text. 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.)
- Modify Bullseye.java and Bullseye.html as follows:
- Change Bullseye.java to Quilt.java, both the class name and the
file name. Also rename Bullseye.html Quilt.html and change all
internal references from Bullseye to Quilt.
- Modify the code in Quilt.java to produce one patch of
your quilt. That patch should consist of four concentric circles with
each circle being a different color of your choice (see page 114 of
your text for more information on the Color class). The "patch"
(i.e., the four concentric circles) should fill 1/3 of the width and
height of your display, as shown below.
- Modify your program to produce the first row of squares in your
quilt. Each row should consist of 3 squares as shown below. (You must
use a looping structure to receive credit for this portion of the
assignment.)
- Complete your quilt by modifying your program to
produce 3 rows of squares as shown below. (You must use a looping
structure to receive credit for this portion of the assignment.) You
are done!
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 file and the HTML file to your ftp
directory for this class. Both the source code file (i.e.,
Quilt.java) and the HTML file (Quilt.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