First let's make the conversions corresponding to the volume:
milliliters to liters:
150 (ml) * (1/1000) (L / mL) = 0.15 L
Liters to cubic decimeters
0.15L * (1/1) (dm ^ 3 / L) = 0.15 dm ^ 3
Then, by definition, density is equal to mass between volumes:
d = m / v
Clearing the mass we have:
m = d * v
Substituting:
m = (42.0 g / dm3) * (0.15 dm ^ 3)
m = 6.3g
answer:
the mass of the sample in grams is
m = 6.3g