Draw a line to represent the length.
Set your compass to more than 1/2 of the length of the line.
Swing an arc from each end of the line and .reaching above and below the line
Draw a line between the intersections of of the 2 sets of arc.
This is the perpendicular bisector of the line; it gives you the width of the rectangle.
Draw right angles at each end of the original line and lay off the width on the vertical leg of the right angle.
Connect those two points
Voila!