These three variables have a common equation:
[tex]D=\dfrac{m}{V}[/tex]
We're given:
Isolate m in the equation:
[tex]m=DV[/tex]
Plug these values into the equation:
[tex]m=(3.62\frac{g}{cm^3})(4.00 cm^{3})\\\\m=14.48g[/tex]
The mass of the sample of barium is 14.48 g.