Subscribe Us

Responsive Advertisement

Advertisement

CSE EXAM-20 OOP PART B 6(a)

 

CSE EXAM-20 OOP PART B 6(a)

BY UJJAL ROY




#include<bits/stdc++.h>

using namespace std;

class students

{

protected :

    int roll;

public :

    void get_roll(int x)

    {

        roll=x;

    }

    void put_roll()

    {

        cout<<"YOUR ROLL : "<<roll<<endl;


    }

} ;

class test :public students

{

protected :

    double sub1,sub2;

public :

    void get_mark(double x,double y)

    {

        sub1=x;

        sub2=y;

    }

    void put_mark()

    {

        cout<<"YOUR mark : "<<sub1<<" "<<sub2<<endl;

    }

};

class result :public test

{

protected :

    double total;

    public:

    void show()

    {

        put_roll();

        put_mark();

       total=sub1+sub2;

       cout<<"total "<<total<<endl;

    }

};

int main()

{


      result r;

      r.get_roll(2000);

      r.get_mark(140,145);

      r.show();


    return 0;

}


Post a Comment

0 Comments