
110 C++ Programming
~CuboidMetal()
{
cout<<"Destructor Called"<<endl;
delete[] metalType; // Deleting array
}
};
int main()
{
CuboidMetal c1 ("Silver",3,4,12,13,1512,10.5);
if(c1.getSuccess())
c1.DeterminePurity(); // DeterminePurity function associated with c1
CuboidMetal c2 ("Silver",3,4,12,13,1512,10.5);
if(c2.getSuccess())
c2.DeterminePurity(); // DeterminePurity function associated with c2
CuboidMetal c3 ("Silver",3,4,12,13,1512,10.5);
if(c2.getSuccess())
c3.DeterminePurity(); // DeterminePurity function associated with c2
}
Output
Metal type is: Silver
Volume is: 144
Density is: 10.5
Metal Silver is pure.
Metal type is: Silver
Volume is: 144
Density ...