A cube with a mass of 40 g is made from a metal with a density of 7 g/cm3. What is the volume of the cube and the length of each edge?