Advertisement
Guest User

Untitled

a guest
May 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13.  class box
  14. {
  15. int x_dim;
  16. int y_dim;
  17. int z_dim;
  18. //KATASKEYASTHS
  19. public:
  20. box(int a,int b,int c)
  21. {
  22.     x_dim=a;
  23.     y_dim=b;
  24.     z_dim=c;
  25. }
  26. ~box()
  27. {cout<<"h katastrofh sou "<<endl;
  28. }
  29.  
  30.  
  31. void set_values (int a,int b,int c)
  32. {   x_dim=a;
  33.     y_dim=b;
  34.     z_dim=c;
  35. }
  36.  
  37. int get_volume()
  38. {
  39. int volume;
  40. volume=x_dim*y_dim*z_dim;
  41. return volume;
  42. }
  43. string get_size()
  44. {
  45.     string size;
  46.     int vol= x_dim*y_dim*z_dim;
  47.     if (vol<10)
  48.     {
  49.         size="small";
  50.     }
  51.     else if (vol<20 )
  52.     {
  53.         size="medium";
  54.     }
  55.      else
  56.     {
  57.         size="large";
  58.     }
  59.    
  60.     return size;
  61. }
  62.  
  63.  
  64. };
  65.  
  66. int main()
  67. {
  68.    int i;
  69.    box Ar[40];
  70.    box kouti(25,25,20);
  71.    cout<<kouti.get_volume()<<endl;
  72.    cout<<kouti.get_size()<<endl;
  73.    for(i=0;i<40;i++)
  74.    {
  75.        
  76.    }
  77.    }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement