With composition of functions (as with the order of operations) we perform what is inside of the parentheses first. So, g(3)=2(3)+2=8 and then f(8)=24.
Since this is a right triangle, you can plug it into Pythagoras theorem of a squared plus b squared equals c squared. So 198 squared plus 40 squared equals 40804. Square root this and it gives you 202 meters.