Squares 1 and 2 have the same area because they're both (a+b) on a side.
Each of these squares is covered by four identical right triangle tiles, legs a,b, hypotenuse c. Â
In the first picture we see the uncovered part of the square, not covered by triangular tiles, is two squares, area [tex]a^2+b^2[/tex].
In the second picture the uncovered part of the square is a smaller square, area [tex]c^2[/tex].
We just moved the tiles around on the square, so the uncovered part is the same in both cases. Â So
[tex]a^2 + b^2 = c^2[/tex]
--------
The rectangular prism has a bottom rectangular base 6 by 8.  So  the diagonal is [tex]\sqrt{6^2+8^2}=\sqrt{100}=10[/tex].
The diagonal and the 7 cm side make a right triangle whose hypotenuse is the diagonal of the rectangular prism we seek.
[tex]\sqrt{10^2 + 7^2} = \sqrt{149}[/tex]
Answer: √149