-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut38.cpp
46 lines (43 loc) · 805 Bytes
/
tut38.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include<iostream>
using namespace std;
void name(){
cout<<'Author: Varun Gupta'<<endl;
}
class Cuboid
{
int l;
public:
int b,h;
void SetValues()
{
cout<<"Enter the length ,breadth and height of the cuboid :"<<endl;
cin>>l>>b>>h;
}
int length()
{
return l;
}
};
class Volume : public Cuboid
{
int Vol;
public:
void Cal()
{
Vol=length()*b*h;
cout<<"The volume is :\n"<<Vol<<endl;
}
void outdata()
{
cout<<"These are the length,breadth and height of the cuboid \n:"<<length()
<<endl<<b<<endl<<h<<endl;
}
};
int main(){
name();
Volume V1;
V1.SetValues();
V1.outdata();
V1.Cal();
return 0;
}