Write a program to print the volume of a box by creating a class named 'Volume' with an initialization list to initialize its length, breadth and height. (just to make you familiar with initialization lists)
class Box {
public:
Box(double x, double y, double z)
: length(x), breadth(y), height(z) {}
double volume() const { return lenght * breadth * height; }
private:
double length;
double breadth;
double height;
}
Comments
your team is excellent
Leave a comment