You are to implement five classes. The behavior of each class is described below.

Class getChar getMove
Bird B Randomly selects one of the four directions each time
Frog F Picks a random direction, moves 3 in that direction, repeat (same as bird, but staying in a single direction longer)

For the random moves, each possible choice must be equally likely. You may use either a Random object or the Math.random() method to obtain pseudorandom values.

The first four of these classes won’t use the CritterInfo object that is passed to getMove. This object is provided in case you want to do something with this information in defining your Wolf class. See the description of CritterInfo later in the writeup.

The critter world is divided into cells that have integer coordinates, much like the pixels in a DrawingPanel. There are 100 cells across and 50 cells up and down. As with the DrawingPanel, the upper-left cell has coordinates (0, 0), increasing x values move you right and increasing y values move you down.

Notice that the Critter class defines five constants for the various directions. You can refer to these using the name of the interface (Critter.NORTH, Critter.SOUTH, etc) or you can refer to them directly (NORTH, SOUTH, etc) because you are implementing the interface. Your code should not depend upon the specific values assigned to these constants, although you may assume they will always be of type int. You will lose style points if you fail to use the named constants when appropriate. As noted above, your critter can stay in its current location by indicating that the direction it wants to move is CENTER.

Here is the implementation of the given classes in Java:

```java
import java.util.Random;

interface Critter{
int NORTH = 0;
int SOUTH = 1;
int EAST = 2;
int WEST = 3;
int CENTER = 4;
}

class Bird {
public int getMove() {
Random random = new Random();
return random.nextInt(4);
}
}

class Frog {
private int direction;
private int movesLeft;

public Frog() {
Random random = new Random();
direction = random.nextInt(4);
movesLeft = 3;
}

public int getMove() {
if (movesLeft == 0) {
Random random = new Random();
direction = random.nextInt(4);
movesLeft = 3;
}
movesLeft--;
return direction;
}
}
```

In the above code, the `Bird` class randomly selects one of the four directions each time `getMove` method is called. The `Frog` class also randomly selects a direction, but it stays in the same direction for 3 moves before picking a new direction. The `getMove` method is implemented to achieve this behavior.