
230 C++ Programming
{
c[0]=new CuboidMetal(nCuboid1, l1, b1, h1, mCuboid1, aCuboid1);
c[1]=new CuboidMetal(nCuboid2, l2, b2, h2, mCuboid2, aCuboid2); // Copy constructor
// can be used here
s=new SphericalMetal(nSpherical1,r1,mSpherical1,aSpherical1);
}
void DeterminePurity()
{
cout<<"\n MixedMetal Metalwise Purity Details:"<<endl;
c[0]->DeterminePurity(); // Checks purity of CuboidMetal1
c[1]->DeterminePurity(); // Checks purity of CuboidMetal2
s->DeterminePurity(); // Checks purity of SphericalMetal1
}
~MixedMetal()
{
delete c[0];
delete c[1];
delete s;
}
};
int main()
{
MixedMetal m("Silver",10,9.5,2.8,2793,10.5,"Silver",9,9.5,2.8,2793,10.5,"Silver",21,407484,0.5); ...