// Name: Rick Halterman // Assignment number: 4 // Assignment: Graphical Tic-Tac-Toe Game // File name: TicTacToeLogic.java // Date last modified: June 13, 2012 // Honor statement: I have neither given nor received any unauthorized help on this assignment.
Including your name reassures me that the code I am grading actually is the person's code that I think it is. It also ensures that you will get the proper credit you are due. The honor statement reminds you that, unless specified otherwise, each assignment represents an individual effort and copying others' code is forbidden.
A Stub is a routine that doesn't actually do anything other than declare itself and the parameters it accepts and returns something that is usually the values expected in one of the 'happy scenarios' for the caller. Stubs are used commonly as placeholders for implementation of a known interface, where the interface is finalized/known but the implementation is not yet known/finalized. The stub contains just enough code to allow it to be compiled and linked with the rest of the program.
Help is readily available in the lab for resolving compiler errors; please take advantage of it.
You should examine any compiler warnings very carefully because often they infer subtle bugs in your code.
/*****************************
* div(m, n)
* Returns m divided by n
*****************************/
public static int div(int m, int n) {
return m/n;
}
Really? What if n is zero? Your method comment should include the method's behavior under exceptional circumstances. A better description for the particular method above would be
/*****************************
* div(m, n)
* Returns m divided by n.
* The method's behavior is
* undefined when n is zero.
*****************************/
public static int div(int m, int n) {
return m/n;
}
Please do your best to limit the length of each line of your source code to 80 characters or less.
| Points | Qualification |
|---|---|
| 0 | Program does not address the assigned problem. |
| 1 | Program appears to address the assigned problem but does not compile. |
| 2–7 | Program compiles without errors and addresses various aspects of the assigned problem but contains logic errors or is functionally incomplete. Program may produce run-time errors. |
| 8 | Program compiles, behaves correctly in most situations, but it exhibits some incorrect behavior or is unreasonably slow performing some activities. |
| 9 | Program compiles, behaves correctly in all situations, and performs efficiently in all situations. |
| 10 | Program compiles, behaves correctly in all situations, performs efficiently in all situations, uses consistent style, good naming practices, and is well commented. |
Compiler warnings will not affect the assignment's grade; however, review the remarks above about the dangers of ignoring compiler warnings.