We know from the question that,
l = 5 + w
p = 34 cm
General formula for perimeter of rectangle
2 (l + w) = perimeter
Now subtitute l with 5 + w to the formula
2 (l + w) = perimeter
2 (5 + w) = 34
10 + 2w = 34
2w = 34 - 10
2w = 24
w = 12
Find the length
l = 5 + w
l = 5 + 12
l = 17
The dimension of the rectangle
width = 12 cm
length = 17 cm