Answer
See work below.
Work Step by Step
a. Density is mass divided by volume.
$$\rho=\frac{M}{\frac{4}{3}\pi r^3}$$
$$ =\frac{1.99\times10^{30}kg}{\frac{4}{3}\pi (6.38\times10^{6}m)^3}$$
$$=1.83\times10^{9}kg/m^3$$
b. The volume is the same as that of the Earth, so the ratio of the densities is the ratio of the masses.
$$\frac{\rho_{wd}}{\rho_E}=\frac{M_{wd}}{M_E}$$
$$=\frac{1.99\times10^{30}kg }{5.98\times10^{24}kg }=3.33\times10^5$$