CS242: Advanced Programming Concepts in JAVA

Fall 2008

Program 2

Due: 10:00 AM, Monday, 9/8/08

For this assignment you will create a simple Java program. You must work individually on this program. It is also a good idea to use a browser to view the Java2 API documentation and accustom yourself to using this resource. This documentation can be easily downloaded (see the link in Online Resources) so that you have a local copy.

(a) Following the examples in class, the reading assignments, and the Java Tutorials, create a "Board" class which models a standard checker or chess board. This should be in a source file named Board.java, and your class must satisfy the requirements given below; that is, you are not free to change the names, types, or behavior of the specifications.

A gameboard may be thought of as an 8X8 2-dimensional array. The rows are numbered 0-7 top to bottom, and the columns are numbered 0-7 left to right. In this assignment, the elements in the array have only two possible values: empty or occupied (or any pair of values you prefer, such as 0 or 1, ' ' or '*', 'O' or 'X'). Empty means the there is no game piece on the square; occupied means there is a game piece on the square.

Your grade will be based on how well you design and implement the code, on good programming practices, and on thorough testing. Coding guidelines for Java programs are posted here.

We won't be covering classes and constructors until late this week or next week, so your program should consist of only one class, which must be structured as follows:

You should decide how your program handles bad data. Just ignoring it is not a good solution.

(b) Add comment documentation to your program and use javadoc to extract the documentation into an HTML file. Include a javadoc comment for the Board class. The class comment should include your name and the date (use the @author tag). Although these are small classes now, and this may seem like a lot of commenting, we will expand on this assignment at a later date.

The physical location of the javadoc comments is critical. A class comment must immediately precede the line containing the keyword class.

When you have commented your source files, run javadoc to create the .html files and view them in a browser of your choice.


What to submit:
Your grade on the program will be based on: