The density (d) is the quotient when mass (m) is divided by the volume (v). It is specified that the densities be in units of g/cm³. So, there is a need to convert first the given mass and volume to proper units. The calculations are shown below,
2 m³ x (100 cm / 1 m)³ = 2.0x10^6 cm³
1x10^4 kg x (1000 g/ 1 kg) = 1.0x10^7 g
Calculating for density,
d = m/v = (1.0x10^7 g) / (2.0x10^6 cm³) = 5 g/cm³