Total Pageviews

Monday, April 23, 2012

PRACTICAL QUIZ 4 MOVE CATFISH RIGHT

public class Catfish {

    /** Location of the catfish - which column. */
     */
    private int column = 1;

    /**
     * Location of catfish - the column
     *
     * @return - an integer representing the column location of catfish.
     */
    public int getColumn() {
    return column;
    // Student: return the column value

    }

    /**
     * Swim one cell to the right by incrementing the value stored in column by 1.
     */
    public void swimRight() {
    column = column + 1;
    // Student: Increment the value stored in column attribute by 1.

    }
}

No comments:

Post a Comment