The thing I want to point out is that is defined as mass over unit of volume. Therefore, regardless of what actual unit you use to express it, you must always have a unit of mass divided by a unit of volume.
The of aluminium should therefore be expressed in ##”g/cm”^3##, since ##”g/cm”## is actually a measure of mass per length, not per volume.
That being said, you go about solving this problem by using the formula for density
##rho = m/V => V = m/(rho)##
In this case,
##V_(“cube”) = m_(“cube”)/(rho) = “16.2 g”/(2.7 “g”/”cm”^3) = “6.0 cm”^3##
SInce you’re dealing with a perfect cube, the volume can be expressed as
##V_(“cube”) = “side”^3##
Therefore,
##”side” = root(3)(6) = “1.82 cm”##