So what? you may say… I can do the same thing in C!
float totalVolume (struct *bptr[])
elseif (b->type == CYLINDER)
volume += CylinderVolume(b);
float totalSurface (struct *bptr[])
volume += CubeSurface(b);
elseif (b->type == CYLINDER)
volume += CylinderSurface(b);
All right, that would work. But what if you get a new type of body, say, a Cone?