```python
def volume_cube(l):
  """
  Calculates the volume of a cube.

  Args:
    l: The length of a side of the cube.

  Returns:
    The volume of the cube. Returns 0 if the length is not positive.
  """
  if l <= 0:
    return 0
  
  volume = l ** 3
  return volume
```