so.. if you check the picture below, the "width" of the rectangle, is really just 2r
thus [tex]\bf \textit{perimeter of the semi-circle}\\\\
P_s=\cfrac{2\pi r}{2}\to \pi r
\\\\\\
\textit{perimeter of the rectangle}\\\\
P_r=h+h+2r\to 2(h+r)
\\\\\\-----------------------------\\\\
\textit{perimeter of the window}\\\\
P_w=P_s+P_t\implies 20=\pi r+2(h+r)\implies 10-\cfrac{\pi r}{2}=h+r
\\\\\\
\boxed{10-\cfrac{\pi r}{2}-r=h}[/tex]
now.. as for the Area of it
[tex]\bf
\textit{area of the semi-circle}\\\\
A_s=\cfrac{\pi r^2}{2}
\\\\\\
\textit{area of the rectangle}\\\\
A_r=2hr\implies 2\left( 10-\cfrac{\pi r}{2}-r \right)r\implies 20r-\pi r^2-2r^2\\\\
-----------------------------\\\\
\textit{area of the window}\\\\
A_w=A_s+A_r\implies \boxed{A_w=\left( \cfrac{\pi r^2}{2} \right)+\left( 20r-\pi r^2-2r^2 \right)}[/tex]