```python
import math

def surfacearea_cone(r, h):
  """
  Calculates the surface area of a cone.

  Args:
    r: The radius of the base of the cone.
    h: The height of the cone.

  Returns:
    The total surface area of the cone.
  """
  # Calculate the slant height using the Pythagorean theorem
  slant_height = math.sqrt(r**2 + h**2)
  
  # Calculate the area of the circular base
  base_area = math.pi * r**2
  
  # Calculate the area of the lateral surface
  lateral_area = math.pi * r * slant_height
  
  # Total surface area is the sum of the base and lateral areas
  total_surface_area = base_area + lateral_area
  
  return total_surface_area
```