Well I'm sure many a time you've seen on some science experiment someone wrap a copper wire around a nail well thats generally the idea for electromagnets you get a solid piece of iron which is the only metal that is magnetic and you wrap a copper wire around it and the idea is to make two opposing magnetic poles by aligning the molecules with a electrical charge (a battery) so now with all three pieces assembles you have a copper wire attached to two sides of a battery and wrapped around a nail
Well assuming we have all of these, earth
Explanation:
Density of object = gram/volume
= 100 g/ 5 cm³
= 20 g/cm³