Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Point{
- public:
- int x,y;
- };
- class Circle : public Point{
- protected:
- int r;
- };
- class Cylinder : public Circle{
- protected:
- int h;
- public:
- void show(){
- std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
- std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
- std::cout << x << ", "<< y <<", "<< r <<", " << h <<"\n";
- }
- Cylinder(int x,int y, int r, int h){
- int get_x, get_y, get_r;
- }
- };
- int main(){
- Cylinder obj1(2, 3, 4, 5);
- Cylinder obj2(90, 9, 5, 32);
- Cylinder obj3(6, 8, 3, 10);
- obj1.show();
- obj2.show();
- obj3.show();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment