SHARE
TWEET

Untitled

daniil_mironoff Jul 22nd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. class Box {
  3.     private:
  4.         int l;
  5.         int b;
  6.         int h;
  7.  
  8.     public:
  9.         Box() : l(0), b(0), h(0) {}
  10.         Box(int len, int brd, int hgt) : l(len), b(brd), h(hgt) {}
  11.  
  12.         Box(Box& obj) : l(0), b(0), h(0) {
  13.             l = obj.l;
  14.             b = obj.b;
  15.             h = obj.h;
  16.         }
  17.  
  18.         int getLength() {
  19.             return l;
  20.         }
  21.  
  22.         int getBreadth() {
  23.             return b;
  24.         }
  25.  
  26.         int getHeight() {
  27.             return h;
  28.         }
  29.  
  30.         int CalculateVolume() {
  31.             return l * b * h;
  32.         }
  33.  
  34.         bool operator < (Box& obj) {
  35.             if (CalculateVolume() < obj.CalculateVolume()) {
  36.                 return true;
  37.             } else {
  38.                 return false;
  39.             }
  40.            
  41.         }
  42.  
  43. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top