Use pythagorean theorem
a^2 + b^2 = c^2
2^2 + 5^2 = 29
c^2 = 29
The distance from the school to the basketball courts is C, so to get C on its own we need to square root 29, which gives us 5.385.....
We need to round this to the nearest mile, so Josh would need to walk 5 miles. Hope this helps!!