Multiple Inheritance (Intake 41-4)

Question

Create a class call house, which has two attributes(door, window). Create another two class called office and home which also have two attributes respectively table and bed. Now inherit office and home into house. Create an object of class  house and show all.

in progress 1
Ask me anything 8 months 24 Answers 303 views 1

Answers ( 24 )

  1. NAME:MD. Emon Ali
    ID:18192103154

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  2. Name: Tabassum Mehrin Prova
    ID:177
    Sec:4
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  3. Name. Asfack uddin nabil
    Id.173
    Ses.4
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  4. Name:Mst.Shamima Akter Shimu Id:18192103144

    #include

    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  5. Name: Rakibul Hasan Shafin
    ID: 18192103165
    Intake: 41
    Section :04
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  6. #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  7. D.k.Shah Alam
    ID-18192103176

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    };
    int main ()
    {

    house obj;
    obj.door=5;
    obj.window=9;
    obj.table=5;
    obj.bed=4;
    cout<<"Door="<<obj.door<<endl<<"window="<<obj.window<<endl<<"table="<<obj.table<<endl<<"bed="<<obj.bed<<endl;
    return 0;
    }

  8. Name: Nigar Sultana Era
    Id:175
    Sec:4
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  9. #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  10. //Name: Syeda Nafia Sultana, ID: 17181103058, Intake: 37//
    #include
    using namespace std;
    class office{
    public:
    int table;};
    class home{
    public:
    int bed;};
    class house:public office,public home{
    public:
    int door,window;
    int attribute()
    {return door+window+table+bed;}};
    int main (){
    house obj;
    obj.door=8;
    obj.window=9;
    obj.table=5;
    obj.bed=3;
    cout<<"House = "<<obj.attribute()<<endl;
    return 0;}

  11. ID:18192103149
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  12. Name: Tamanna Tasnim
    ID:142

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  13. Arman Hossain
    ID-18192103156

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    };
    int main ()
    {

    house obj;
    obj.door=5;
    obj.window=9;
    obj.table=5;
    obj.bed=4;
    cout<<"Door="<<obj.door<<endl<<"window="<<obj.window<<endl<<"table="<<obj.table<<endl<<"bed="<<obj.bed<<endl;
    return 0;
    }

  14. Name:Sanjara
    ID:18192103166

    #include
    using namespace std;

    class office{
    public:
    int table;
    };
    class home{

    public:
    int bed;
    };
    class house:public office,public home{

    public:
    int door,window;
    int attribute()
    {
    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  15. Name : MD Masudul Islam Asif
    ID : 147

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  16. Name: Md. Mintu Hossain
    ID:17181103110
    Intake: 37

    #include
    using namespace std;
    class Office
    {
    public:
    int table;
    };
    class Home
    {
    public:
    int bed;
    };
    class House:public Office:public Home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    House ob;
    ob.door=5;
    ob.window=10;
    ob.table=10;
    ob.bed=5;
    cout<<"Product is = "<<ob.attribute()<<endl;
    return 0;
    }

  17. Md. Jahinur islam
    Id:169

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  18. NAME:shaminur Rahman
    ID:158

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  19. Name: Rois Uddin Khan Emon
    Intake: 41
    Section: 4
    ID: 18192103153

    #include
    #include
    using namespace std;

    class office{
    public:
    int table;
    };
    class home{
    public:
    int bed;
    };
    class house : public office, public home{
    public:
    int door, window;
    };

    int main(){
    house obj;
    obj.door = 1;
    obj.window = 2;
    obj.bed = 3;
    obj.table = 4;
    cout<<"Door: "<<obj.door<<endl;
    cout<<"Window: "<<obj.window<<endl;
    cout<<"Bed: "<<obj.bed<<endl;
    cout<<"Table: "<<obj.table<<endl;
    return 0;
    }

  20. Name: MD Tayeb
    Inatek: 41
    Sec: 4
    Id:18192103164

    #include

    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  21. ID:18192103139
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  22. NAME : Arup Raton Chowdhury
    ID:18192103155

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  23. NAME:MD Ashraful Hossain
    ID:18192103137
    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {
    return door+window+table+bed;
    }
    };
    int main ()
    {
    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

  24. Md Mahbubur Rahman Khan
    id-18192103150

    #include
    using namespace std;
    class office
    {
    public:
    int table;
    };
    class home
    {
    public:
    int bed;
    };
    class house:public office,public home
    {
    public:
    int door,window;
    int attribute()
    {

    return door+window+table+bed;
    }
    };
    int main ()
    {

    house obj;
    obj.door=1;
    obj.window=2;
    obj.table=3;
    obj.bed=4;
    cout<<"Product is="<<obj.attribute()<<endl;
    return 0;
    }

Leave an answer