Assignment 2
Get description at: www.cs.wisc.edu/~cs302/assignments
Due date: Monday 3/1 by 4:00pm (both electronic and paper copies)
Hand in electronically: RobotRally.java
Robot.java
Peg.java
questions.txt
Hand in printed copies: RobotRally.java
Robot.java
Peg.java
Please note:
1) Make sure you understand which classes you’ve been given and which you have to write. For the ones you have to write, make sure you understand which are instantiable classes and which are not. Do read the whole assignment before starting, even though the description is kind of long.
2) I’m going to require complete Javadoc comments in your instantiable classes this time. A Javadoc comment is a special comment format that goes above each data member and method. Here are examples:
/**
This tells briefly what the data member stores. */
private int myData;
/**
* This describes briefly what the method
does. The next two lines describe
* the parameters, and the final line
describes the return value.
*
@param x The first operand
*
@param y The second operand
*
@return The sum of the operands
*/
public
int sum (int x, int y) {
return x+y;
}
I’d suggest writing these comments first, so you have a kind of comment skeleton, and then
filling in the methods one by one. It helps you see the big picture while you’re programming.