
Class Features 87
else
cout<<"Metal "<<metalType<<" is not pure."<<endl;
}
};
int main()
{
CuboidMetal c1 ("Silver",7,3,4,5.5,2793,5.9375);
if(c1.getSuccess())
c1.DeterminePurity(); // DisplayData function associated with c1
}
Output
Object cannot be created with these attributes. Please verify.
get and set methods are used to retrieve (get) and set the attributes of an object, respectively.
The class member function used to access (get) attributes of a class is known as the getter
method, while that used to set attributes of a class is known as the setter method. It is not ad-
visable to expose attributes of class to the user. Hence, getter and setter ...