In the first example we must calculate hypotenuse's length using pythagorean theorem
c^2 = a^2 + b^2 => c^2 = 24^2 + 6^2 = 576 + 36 = 612 =>
c = square root of 612 + 24.74 ft
perimeter P1 = a+b+c = 24+6+24.74= 54.74 ft
In the second example we must calculate second leg in the same manner
a^2 = c^2 - b^2 => a^2 = 15^2 - 9^2 = 225 - 81 = 144 =>
a = square root of 144 = 12
perimeter P2= 15+9+12=36 ft
Good luck !!!!