If I cover the boxes and properly secure the cables per code can they be hidden or do I have to surface mount them?
They must be "accessible without removing any part of the building or structure". If they're accessible from below (ceiling fixture box, etc.), then they can be covered. If the only way to access them is from the attic, then covering them with flooring violates the code.
If you create an easily removable cover, then you might get it approved. But simply nailing/screwing down plywood, is likely not acceptable.
National Electrical Code 2014
Chapter 3 Wiring Methods
Article 314 Outlet, Device, Pull, and Junction Boxes; Conduit Bodies; Fittings; and Handhole Enclosures.
314.29 Boxes, Conduit Bodies, and Handhole Enclosures to Be Accessible. Boxes, conduit bodies, and handhole enclosures shall be installed so that the wiring contained in them can be rendered accessible without removing any part of the building or structure, or, in underground circuits, without excavating sidewalks, paving, earth, or other substance that is to be used to establish the finished grade.