Page 570 - AP Computer Science A, 7th edition
P. 570
}
∗/
public int getColNumber() { return colNumber; }
public String toString()
{ /∗ implementation not shown
∗ /}
A contestant in the contest can be represented by a Contestant class, whose partial implementation is shown below .
public class Contestant {
private String name; private int score; private Location loc;
/∗ ∗ @return the name public String getName() { return name; }
/∗ ∗ @return the score of this public int getScore()
{ return score; }
∗ / ∗ /
of this
contestant
contestant
/∗∗ @return the location of this contestant ∗/
public Location getLocation()
{ return loc; }
/∗∗ Changes the location of this contestant to a new row
∗ and column.
∗ @param newRow the new row
∗ @param newCol the new column ∗/
public void updateLocation(int newRow, int newCol)
{ /∗ to be implemented in part (a) ∗/ }
//Constructor and other methods are not shown. }