Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- class box
- {
- int x_dim;
- int y_dim;
- int z_dim;
- //KATASKEYASTHS
- public:
- box(int a,int b,int c)
- {
- x_dim=a;
- y_dim=b;
- z_dim=c;
- }
- ~box()
- {cout<<"h katastrofh sou "<<endl;
- }
- void set_values (int a,int b,int c)
- { x_dim=a;
- y_dim=b;
- z_dim=c;
- }
- int get_volume()
- {
- int volume;
- volume=x_dim*y_dim*z_dim;
- return volume;
- }
- string get_size()
- {
- string size;
- int vol= x_dim*y_dim*z_dim;
- if (vol<10)
- {
- size="small";
- }
- else if (vol<20 )
- {
- size="medium";
- }
- else
- {
- size="large";
- }
- return size;
- }
- };
- int main()
- {
- int i;
- box Ar[40];
- box kouti(25,25,20);
- cout<<kouti.get_volume()<<endl;
- cout<<kouti.get_size()<<endl;
- for(i=0;i<40;i++)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement