Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Box {
- private:
- int l;
- int b;
- int h;
- public:
- Box() : l(0), b(0), h(0) {}
- Box(int len, int brd, int hgt) : l(len), b(brd), h(hgt) {}
- Box(Box& obj) : l(0), b(0), h(0) {
- l = obj.l;
- b = obj.b;
- h = obj.h;
- }
- int getLength() {
- return l;
- }
- int getBreadth() {
- return b;
- }
- int getHeight() {
- return h;
- }
- int CalculateVolume() {
- return l * b * h;
- }
- bool operator < (Box& obj) {
- if (CalculateVolume() < obj.CalculateVolume()) {
- return true;
- } else {
- return false;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement