The weight is influenced by the density and the volume. In this case, you are given the density of gasoline(0.65g/ml) and the volume (31l or 8 gallons). Since the unit is different, that mean you need to convert it. It will be easier to convert liter into ml than gallon so we will use 31L as volume. The calculation would be:
mass=density * volume= 0.65g/ml * 31l * (1000ml/l) * (1kg/1000gram)= 20.15kg