Area=length x width, right?
So let A=lw represent the area of either the square or the rectangle. I'll use the square to solve this.
Area of square=lw
Area of rectangle=(l+5)(w-4)=lw-4l+5w-20
Now, two more pieces of information you need to use to solve it:
The areas are equal, so lw-4l+5w-20=lw
Thus 5w-4l-20=0
Also, remember that all sides of a square are equal, so l=w. Thus, the equation can be re-written as
5l-4l-20=0
l=20
l=w, so
w=20
Area of the square room (dimensions 20 X 20)=400ft^2
Area of rectangular room (dimensions 25 X 16)=400ft^2