Answer
(a) The average density of the sun is $1.409\times 10^3~kg/m^3$.
(b) The average density of a neutron star is $5.94\times 10^{16}~kg/m^3$.
Work Step by Step
(a) We can find the volume of the sun.
$V = \frac{4}{3}\pi~r^3$
$V = \frac{4}{3}\pi~(6.96\times 10^8~m)^3$
$V = 1.412\times 10^{27}~m^3$
We can find the average density of the sun.
$\rho = \frac{M}{V}$
$\rho = \frac{1.989\times 10^{30}~kg}{1.412\times 10^{27}~m^3}$
$\rho = 1.409\times 10^3~kg/m^3$
The average density of the sun is $1.409\times 10^3~kg/m^3$
(b) We can find the volume of a neutron star.
$V = \frac{4}{3}\pi~r^3$
$V = \frac{4}{3}\pi~(2.00\times 10^4~m)^3$
$V = 3.351\times 10^{13}~m^3$
We can find the average density of a neutron star.
$\rho = \frac{M}{V}$
$\rho = \frac{1.989\times 10^{30}~kg}{3.351\times 10^{13}~m^3}$
$\rho = 5.94\times 10^{16}~kg/m^3$
The average density of a neutron star is $5.94\times 10^{16}~kg/m^3$.