shape is a class type not an object. You should keep the pointer to shape in Your constructor. It should be like:
Your class member:
shape * theShape;
And your constructor:
prism(shape* sh, double a)
{
z=a;
theShape =sh;
}
And your getVolume() should be like:
double getVolume(){ return theShape->getArea()*z;}