public class Moon
{
    public Moon (int x, int y, int z)
    {
        _position = new Coordinate(x, y, z);
        _velocity = new Velocity();  // the x, y, and z velocity of each moon starts at 0.
    }

    @Override
    public String toString ()
    {
        return "Moon: "+_position+" and "+_velocity;
    }

    private Coordinate _position;
    private Velocity _velocity;
}
@@ -306,24 +306,1596 @@
 ity;%0A    %7D%0A%0A
+    /*%0A     * On each axis (x, y, and z), the velocity of each moon changes by%0A     * exactly +1 or -1 to pull the moons together.%0A     */%0A%0A    public final void applyGravity (Moon otherMoon)%0A    %7B%0A        if (!this.equals(otherMoon))%0A        %7B%0A            int x1 = _position.getX();%0A            int x2 = otherMoon._position.getX();%0A%0A            if (x1 %3E x2)%0A            %7B%0A                _position.setX(x1 -1);%0A                otherMoon._position.setX(x2 +1);%0A            %7D%0A            else%0A            %7B%0A                if (x1 %3C x2)%0A                %7B%0A                    _position.setX(x1 +1);%0A                    otherMoon._position.setX(x2 -1);%0A                %7D%0A            %7D%0A%0A            int y1 = _position.getY();%0A            int y2 = otherMoon._position.getY();%0A%0A            if (y1 %3E y2)%0A            %7B%0A                _position.setY(y1 -1);%0A                otherMoon._position.setY(y2 +1);%0A            %7D%0A            else%0A            %7B%0A                if (y1 %3C y2)%0A                %7B%0A                    _position.setY(y1 +1);%0A                    otherMoon._position.setY(y2 -1);%0A                %7D%0A            %7D%0A%0A            int z1 = _position.getZ();%0A            int z2 = otherMoon._position.getZ();%0A%0A            if (z1 %3E z2)%0A            %7B%0A                _position.setZ(z1 -1);%0A                otherMoon._position.setZ(z2 +1);%0A            %7D%0A            else%0A            %7B%0A                if (z1 %3C z2)%0A                %7B%0A                    _position.setZ(z1 +1);%0A                    otherMoon._position.setZ(z2 -1);%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A
     private 

Update Moon.java