Since the shape is a cube, the length, height, and width all have to have the same measure.
If volume = l × w ×h and the volume is given as 512, then the cube root of 512 is 8 inches (8 ×8 ×8 = 512).
The key is to find a factor which, when multiplied by itself 3 times, will yield 512.