Object Oriented Programming Practice (Intake 41)

Question

Write a program by using two classes called A and B where the constructor of each class takes one int and one char type value as an argument and the constructor shows the message “in oop class”. Complete the program considering the following case: A class inherits class B. Create an object of A class and show the output.

in progress 0
Ask me anything 2 weeks 18 Answers 175 views 0

Answers ( 18 )

  1. Sorry it a private answer.

  2. name:Md.Emon Ali
    ID:154

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  3. Name: Tamanna Tasnim
    ID:142

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’x’,int=1)
    {
    char c;
    int x;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='y',int=1)
    {
    char c;
    int y;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  4. Name:Tabassum Mehrin Prova
    ID:177
    Sec:4
    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  5. ID- 18192103180

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  6. Name:sabila
    ID:136
    Sec:4
    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  7. name:shaminur
    ID:158

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  8. Name: Md. Mintu Hossain
    ID: 17181103110

    #include
    using namespace std;
    class A
    {
    public:
    A(char=’A’,int=110)
    {
    char ch;
    int val_1;
    cout<<"in oop class"<<endl;
    }
    };
    class B:public A
    {
    public:
    B(char='B', int=100)
    {
    char ch;
    int val_2;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  9. Name: Rakibul Hasan Shafin
    ID: 18192103165
    Intake:41
    Section:04
    #include
    using namespace std;
    class A
    {
    public:
    A(char=’A’,int=110)
    {
    char ch;
    int val_1;
    cout<<"in oop class"<<endl;
    }
    };
    class B:public A
    {
    public:
    B(char='B', int=100)
    {
    char ch;
    int val_2;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  10. Name: Rois Uddin Khan Emon
    ID: 18192103153
    Intake: 41
    Sec: 4

    #include
    using namespace std;
    class A
    {
    public:
    A(char=’A’,int=110)
    {
    char ch;
    int val_1;
    cout<<"in oop class"<<endl;
    }
    };
    class B:public A
    {
    public:
    B(char='B', int=100)
    {
    char ch;
    int val_2;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  11. Name: Nigar Sultana Era
    Id: 175
    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  12. Name: MD Tayeb
    Intake: 41
    Sec: 4
    ID- 18192103164

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  13. D.k.Shah Alam
    ID-18192103176
    sec-4

    #include
    using namespace std;
    class B
    {
    public:
    int a;
    char b;
    B(int x,char y)
    {
    a=x;
    b=y;
    cout<<"in oop class"<<endl;
    }
    };

    class A:public B
    {
    public:
    int a;
    char b;
    A(int x,char y):B(x,y)
    {
    a=x;
    b=y;
    cout<<"in oop class"<<endl;
    }
    };

    int main()
    {

    A ob(5,'a');

    return 0;
    }

  14. name:Arup Raton Chowdhury
    ID:155

    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  15. Name:Md Ashraful Hossain
    ID:137
    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=1)
    {
    char c;
    int a;
    cout<<"in oop class"<<endl;
    }
    };
    class A:public B
    {
    public:
    A(char='b',int=1)
    {
    char c;
    int b;
    cout<<"in oop class"<<endl;
    }
    };
    int main()
    {
    A obj;
    return 0;
    }

  16. Name:Arman Hossain
    Id:18192103156
    #include
    using namespace std;
    class B
    {
    public:
    int a;
    char b;
    B(int x,char y)
    {
    a=x;
    b=y;
    cout<<"in oop class"<<endl;
    }
    };

    class A:public B
    {
    public:
    int a;
    char b;
    A(int x,char y):B(x,y)
    {
    a=x;
    b=y;
    cout<<"in oop class"<<endl;
    }
    };

    int main()
    {

    A ob(5,'a');

    return 0;
    }

  17. //Name: Syeda Nafia Sultana, ID: 17181103058, Intake: 37
    #include
    using namespace std;
    class B
    {
    public:
    B(char=’a’,int=2)
    {
    char c; int a;
    cout<<"In oop class"<<endl;
    }};
    class A:public B
    {
    public:
    A(char='b',int=2)
    {
    char c; int b;
    cout<<"In oop class"<<endl;
    }};
    int main()
    {
    A obj;
    return 0;
    }

Leave an answer