Cut two 2 by 4 inch boards to 84 inches (these will be the sides of the bed frame). Cut two 2 by 4 inch boards to 61 inches (these will be the head and foot of the bed frame).
Cut the 2 by 12 board to 61 inches (this will support the head of the bed). Cut the 1 by 6 inch board to 64 inches. Cut each plywood sheet to measure 42 by 64 inches.
Cut the bed's feet from the 2 by 6 inch board. Cut eight pieces 10 inches long.
Sand all of the wood pieces smooth. Wipe dust from wood.
Assemble 2 by 4 inch boards to make frame for mattress. The top and bottom boards will sit inside the side boards. Drive two screws into each corner joint. You should have a rectangle out of 2 by 4 boards.
Position one of the pieces of plywood onto the frame, flush with the top edge. Drive 2-inch screws through the plywood into the 2 by 4 boards every 6 inches around the frame. Position the second piece of plywood and screw into place.
Screw a 1 by 6 inch board to the plywood so that it covers the line where the two pieces of plywood meet. This adds stability and conceals the joint.
Flip the entire piece over, and install the flat (mending) brackets. Space them evenly across the entire width of the bed, and screw into place using 1/2-inch screws.
Screw together two of the eight-inch long 2 by 6 inch boards to make a foot for the bed. Drive four of the 3-inch long screws into the block, turn it over and drive four more screws from the other side. Repeat to make one more (you should have four of those pieces remaining).
Attach the remaining four bed feet to the 2 by 12 inch board. Space equally along the board, with two at the outside edges, and mark their locations with the pencil and straight edge. Drive 3-inch screws through the top of the 2 by 12 inch board, down into the 2 by 6 inch pieces.
Attach the block feet with hinges to the bottom edge of the bed so that when they are in use, they will be flush with the end of the bed. When the bed is folded up, they will hinge down so the feet lie flat against the bed.
Locate the studs where the bed will be located, and mark their locations.
Move the head support piece (the 2 by 12 with its feet) into place against the wall. Use the large L-brackets to attach the support piece to the studs in the wall. Put 3-inch screws into the studs, 1-inch screws into the 2 by 12 board.
Attach the gate hinges to the support piece. Leave the hinges open.
Lift the bed frame onto the support piece, so that it is up against the wall, sitting on the support. Attach the other side of the hinges to the bed frame with 1/2-inch screws in the plywood and longer screws in the 2 by 4 inch boards.
Place the pins that will hold the bed in its upright position. To do this, drill a hole in each bookshelf near the top, on the side of the bookshelf that is touching the bed. When the bed is folded up, the pins will be put into place, and the bed will remain in its upright position.