I don't think that "displacement" is wrong as an answer. It's just that to me it is more of a description of what is happening than the reason it floats or sinks.
The designer of a boat has to make a hull large enough to displace enough water that the weight of the boat and cargo will not sink it. That's not hard to do since we also want the hull large enough to give protection from waves.
But let's say that the designer wants a specific waterline. All they need is the working weight of the boat and then make a specific volume of hull below that specified waterline. That weight/volume ratio has to equal the weight/volume ratio or "density" of the water she will sail in.
That's why you said displacement and I said density.
The designer of a boat has to make a hull large enough to displace enough water that the weight of the boat and cargo will not sink it. That's not hard to do since we also want the hull large enough to give protection from waves.
But let's say that the designer wants a specific waterline. All they need is the working weight of the boat and then make a specific volume of hull below that specified waterline. That weight/volume ratio has to equal the weight/volume ratio or "density" of the water she will sail in.
That's why you said displacement and I said density.