```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 (l) using the Pythagorean theorem
  slant_height = math.sqrt(r**2 + h**2)
  
  # Calculate the area of the base (a circle)
  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 area and the lateral area
  total_surface_area = base_area + lateral_area
  
  return total_surface_area

```