Sample Free-Response Solution (A Exam) (a) public class CircleFish extends Fish { private boolean justTurned; public CircleFish(Environment env, Location loc) { super(env, loc); justTurned = true; } // other constructors and methods not shown } (b) protected Location nextLocation() { Environment env = environment(); Location forward = env.getNeighbor(location(), direction()); Location rightDiag = env.getNeighbor(forward, direction().toRight()); if (justTurned && env.isEmpty(forward)) { return forward; } else if (!justTurned && env.isEmpty(rightDiag)) { return rightDiag; } else { return location(); } } (c) protected void move() { Location oldLoc = location(); Location nextLoc = nextLocation(); if (nextLoc.equals(oldLoc)) { changeDirection(direction().toRight()); justTurned = true; } else { changeLocation(nextLoc); if (!justTurned) { changeDirection(direction().toRight()); justTurned = true; } else { justTurned = false; } } }