Chapter 6: Classes and data abstraction in c++
---------------------------------------...
Create a simple class that is used to represent a box. Each object of this class will store basic information about a box including its height, width, and length. Provide a constructor that initializes the class’ attributes and a set and get functions for each attribute. Provide a function called volume that calculates the volume of a box object.
my work.............
int getHeight();
int getWidth();
int getLength();
int volume();
private:
int height;
int width;
int length;
};
box::box(int h,int w, int l)
{
setHeight(h);
setWidth(w);
setLength(l);
}