Register Now

Login


Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login


Register Now

Welcome to Our Site. Please register to get amazing features .

Class First Look

Write a C++ program that can add two int number, using class, object and set(), get() method.

Upload your code bellow.

About Ask me anything


Follow Me

Comments ( 19 )

  1. Name:Sanjara

    Id:18192103166

    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(100,109);
    cout<<obj.get_a();
    return 0;
    }

  2. Name:  Emon Ali

    ID:154

    Intake : 41   sec:4

     

    #include<iostream>
    using namespace std;
    class firstclass
    {
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstclass:: set_a(int num1, int num2)
    {
    a=num1 + num2;
    }
    int firstclass:: get_a()
    {
    return a;
    }
    int main()
    {
    int num1,num2,sum=0;

    cin>>num1>>num2;
    firstclass obj;
    obj.set_a(num1, num2);

    cout<<“Addition is “<<obj.get_a();
    return 0;

    }

  3. Name: Arman Hossain
    Id-18192103156
    Intake-41 Sec-04

    #include
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(10,15);
    cout<<obj.get_a();
    return 0;
    }

  4. congratulations first 3….

    most first 3 will get surprise gifts at the end of this semester

  5. MD Ashraful Hossain

    ID-18192103137

    Intake-41  , Sec-4

    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(10,20);
    cout<<obj.get_a();
    return 0;
    }

  6. Name: Rakibul Hasan Shafin

    Intake: 41

    Section: 04

    ID: 18192103165

    #include<iostream>
    using namespace std;
    class firstClass
    {
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(10,30);
    cout<<obj.get_a();
    return 0;
    }

  7. Name : Moinul islam
    ID: 18192103180
    In-41 sec-4

    #include
    using namespace std;
    class firstclass
    {
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstclass::set_a(int num1, int num2)
    {
    a = num1 + num2;
    }
    int firstclass:: get_a(){
    return a;

    }
    int main(){
    int num1, num2;

    cin>> num1>> num2;

    firstclass obj;

    obj.set_a(num1, num2);

    cout<<"Addition is "<<obj.get_a();
    return 0;

    }

  8. Name:Md.Muntasir Mamun

    Id.18192103179

    Intake:41

    Sec:4

     

     

    #include<iostream>

    using namespace std;

    class firstClass

    {

    int a;

    public: void set_a(int num1,int num2);

    int get_a();

    };

    void

    firstClass::set_a(int num1,int num2)

    {

    a=num1+num2;

    }

    int firstClass::get_a()

    {

    return a;

    }

    int main()

    {

    firstClass obj;

    obj.set_a(10,30);

    cout<<obj.get_a();

    return 0;

    }

  9. #include
    using namespace std;
    class firstclass
    {
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstclass::set_a(int num1, int num2)
    {
    a = num1 + num2;
    }
    int firstclass:: get_a(){
    return a;

    }
    int main(){
    int num1, num2;

    cin>> num1>> num2;

    firstclass obj;

    obj.set_a(num1, num2);

    cout<<"Addition is "<<obj.get_a();
    return 0;

    }

    Name : Moinul islam
    ID: 18192103180
    In-41 sec-4

  10. Name: Tahmid Hossain Rasel

    Intake:41    Section:4

    ID:18192103168

     

     

    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(50,60);
    cout<<obj.get_a();
    return 0;
    }

  11. Intake 41
    ID:18192103138
    section 4
    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(100,109);
    cout<<obj.get_a();
    return 0;
    }

  12. Name: Arup Raton Chowdhury

    Intake:41 Section:4

    ID:18192103155

    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(10,20);
    cout<<obj.get_a();
    return 0;
    }

  13. #include <iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int nun2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(20,30);
    cout<<obj.get_a();
    return 0;
    }

  14. Name: Tamanna Tasnim
    ID: 142

    #include
    using namespace std;
    class firstclass
    {
    int a;
    public:
    int set_a(int n1, int n2);
    int get_a();
    };
    int firstclass:: set_a(int n1, int n2)
    {
    a=n1+n2;
    }
    int firstclass:: get_a()
    {
    return a;
    }
    int main()
    {
    firstclass obj;
    obj.set_a(10,20);
    cout<< obj.get_a();
    return 0;
    }

  15.  

    Name. Asfack uddin nabil

    Id -173

    Sec-4

    Int- 41

    #include<iostream>
    using namespace std;
    int maim()
    {
    class first class {

    int a,b;
    public
    void set (int num1,int num2)
    int get-a();
    };
    void first class :: set-a(int num1,num2);
    {
    a=num1+num2;
    }
    int first class ::get-a();
    {
    return a;
    }
    }
    int main ()
    {
    first class obj;
    obj.set a (10,20);
    cout <<obj.get-a();
    return 0;
    }

  16. Name:Tabassum Mehrin prova

    ID:177

    sec:4

    #include<iostream>
    using namespace std;
    class firstClass{
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstClass::set_a(int num1,int num2)
    {
    a=num1+num2;
    }
    int firstClass::get_a()
    {
    return a;
    }
    int main()
    {
    firstClass obj;
    obj.set_a(100,109);
    cout<<obj.get_a();
    return 0;
    }

  17. ID:18192103149

    #include<iostream>
    using namespace std;
    class firstclass
    {
    int a;
    public:
    void set_a(int num1,int num2);
    int get_a();
    };
    void firstclass:: set_a(int num1, int num2)
    {
    a=num1 + num2;
    }
    int firstclass:: get_a()
    {
    return a;
    }
    int main()
    {
    int num1,num2,sum=0;

    cin>>num1>>num2;
    firstclass obj;
    obj.set_a(num1, num2);

    cout<<“Addition is “<<obj.get_a();
    return 0;

    }

  18. NAME: Bushrat Jahan

    ID: 18192103160

    SECTION: 04

    #include<bits/stdc++.h>
    using namespace std;
    class myclass
    {
    private:
    int a;
    public:
    void set_a(int x, int y)
    {
    a=x+y;
    }
    int get_a()
    {
    return a;
    }
    };
    int main()
    {
    myclass obj;
    obj.set_a(3,5);
    cout<<“addition is “<<obj.get_a()<<endl;
    return 0;
    }

  19. D.K.Shah Alam
    iD.18192103176

    #include
    using namespace std;
    class myClass{
    int x;
    public:
    void set_x(int a,int b)
    {
    x=a+b;
    }
    int get_x()
    {
    return x;
    }
    };

    int main()
    {
    myClass obj;
    obj.set_x(10,10);
    cout<<obj.get_x();
    return 0;
    }

Leave a reply

Captcha Click on image to update the captcha .