Remove seats. Seats will be screwed into the floor. You may have to remove the seat cushions to get to the screws.
Pull up the carpet. Cut into it at one edge and pull hard to get it up. It will be attached with marine glue, so it is unlikely you will be able to salvage enough carpet for reuse.
Unscrew the flooring from the stringers. Once the carpeting is removed, you will see the screws that are holding the wood into place. Remove them and pull the old flooring up.
Replace the old wood with 5/8-inch plywood. You can cut it to size by using the old flooring as a guide. You can also mark the places for the screws by laying the old flooring on top of the new flooring and marking the holes with chalk. Use the screws that were in the old floor and attach the new plywood to the stringers.
Varnish the wood. Use two coats of spar varnish. This will help prevent future rotting.
Lay the new carpeting. Cut to size by laying the old floor on top of the carpeting. Draw a chalk outline around the flooring, leaving about 2-inches extra space all around. Apply a generous amount of marine glue over the entire surface of the floor with a trowel. Press the carpet into place. Trim along the edge of the floor with a utility knife to remove extra carpet.
Replace the seats. Secure them to the new plywood with the same screws they used in the old floor.