Logically, with the rectangle having an area of 35 square feet, and with the perimeter and area both being whole numbers, the probable dimensions of the rug are 5 feet by 7 feet -- and those dimensions give the correct perimeter of 24 feet.
With formal algebra....
Solve the second equation for either variable and substitute in the first equation: