objective: Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right of to the left. Initially, the bug moves to the right, but it can turn to change its direction. Provide a constructor. All methods are included below.
public class Bug {
public Bug(int initial position)
{
position= initialPosition;
}
public void turn();
{
double newOrientation = count* -1;
}
public void move();
{
}
public int getPosition();
}