#include <iostream>
using namespace std; 
class Internal 
{
    public :
    int rollno,i1,i2,i3,q1,q2,q3,a1,a2,a3;
    char name [50];
    void getdata()
    {
        cout <<"Enter the name :";
        cin>>name; 
        cout <<name <<endl; 
        cout <<"Enter the roll no: ";
        cin>>rollno; 
        cout <<rollno <<endl; 
    }
    void getsub1()
    {
        cout <<"Enter the marks for programming in c++"<<endl; 
        cout <<"Enter the internal exam mark : ";
        cin >>i1;
        cout <<i1<<endl; 
        cout <<"Enter the quiz mark : ";
        cin>>q1;
        cout <<q1<<endl; 
        cout <<"Enter the assignment mark: ";
        cin>>a1;
        cout <<a1<<endl; 
    }
    void getsub2()
    {
        cout <<"Enter the marks for data structure "<<endl; 
        cout <<"Enter the internal exam mark : ";
        cin >>i2;
        cout <<i2<<endl; 
        cout <<"Enter the quiz mark : ";
        cin>>q2;
        cout <<q2<<endl; 
        cout <<"Enter the assignment mark: ";
        cin>>a2;
        cout <<a2<<endl; 
    }
        void getsub3()
    {
        cout <<"Enter the marks for accounting "<<endl; 
        cout <<"Enter the internal exam mark : ";
        cin >>i3;
        cout <<i3<<endl; 
        cout <<"Enter the quiz mark : ";
        cin>>q3;
        cout <<q3<<endl; 
        cout <<"Enter the assignment mark: ";
        cin>>a3;
        cout <<a3<<endl; 
        cout <<"----------------------------------------------"<<endl; 
    }
    void display ()
    {
        cout<<"Name :"<<name<<endl; 
        cout <<"Roll no: "<<rollno<<endl; 
        cout <<"----------------------------------------------------------"<<endl; 
        cout <<"programming in c++ Internal marks "<<endl; 
        cout <<"-----------------------------------------------------------"<<endl; 
        cout <<"Exam \t Quiz \t Assignment"<<endl; 
        cout <<i1<<"\t\t"<<q1<<"\t\t"<<a1<<endl; 
        cout <<"----------------------------------------------------------"<<endl; 
        cout <<"Data structure internal marks"<<endl; 
         cout <<"----------------------------------------------------------"<<endl; 
        cout <<"Exam \t Quiz \t Assignment "<<endl; 
        cout <<i2<<"\t\t"<<q2<<"\t\t"<<a2<<endl; 
         cout <<"----------------------------------------------------------"<<endl; 
        cout <<"Financial accounting internal marks "<<endl; 
        cout <<"----------------------------------------------------------"<<endl; 
        cout <<"Exam \t Quiz \t Assignment "<<endl; 
        cout <<i3<<"\t\t"<<q3<<"\t\t"<<a3<<endl; 
    }
};
class External :public Internal 
{
    public :
    int e1,e2,e3;
    void getext()
    {
    cout <<"Enter the external mark for programming in c++: ";
    cin>>e1;
    cout <<e1<<endl; 
    cout <<"Enter the external mark for data structure : ";
    cin>>e2;
    cout <<e2<<endl; 
    cout <<"Enter the external mark for financial accounting :";
    cin>>e3;
    cout <<e3<<endl; 
    }
    void disext()
    {
        cout <<"-------------------------------------------------------"<<endl; 
        cout <<"\t\t External marks "<<endl; 
        cout <<"-------------------------------------------------------"<<endl; 
       cout <<"programming in c++ : " <<e1<<endl; 
       cout <<"Data structure : "<<e2<<endl;
       cout<<"Financial accounting : "<<e3<<endl;
       cout <<"-----------------------------------------------------------"<<endl; 
    }
};
class marklist : public External
{
    public :
    int t1,in1,in2,in3,t2,t3;
    void calculation ()
    {
      in1=i1+q1+a1;
      in2=i2+q2+a2;
      in3=i3+q3+a3;
      t1=in1+e1;
      t2=in2+e2;
      t3=in3+e3;
    }
    void totalmark()
    {
    cout <<"\t\t MARK LIST "<<endl; 
    cout <<"---------------------------------------"<<endl; 
    cout <<"programming in c++"<<endl; 
    cout <<"---------------------------------------"<<endl; 
    cout <<"Int mark \tExt mark\t\ttotal"<<endl; 
    cout <<in1<<"\t\t"<<e1<<"\t\t\t"<<t1<<endl; 
    cout <<"----------------------------------------"<<endl; 
    cout <<"Data structure "<<endl; 
    cout <<"----------------------------------------"<<endl; 
   cout <<"Int mark \tExt mark\t\ttotal"<<endl;
    cout <<in2<<"\t\t"<<e2<<"\t\t\t"<<t2<<endl; 
    cout <<"----------------------------------------"<<endl;
   cout <<"Financial accounting "<<endl; 
   cout <<"-------------------------------------------"<<endl; 
   cout <<"Int mark \tExt mark\t\ttotal"<<endl;
   cout <<in3<<"\t\t"<<e3<<"\t\t\t"<<t3<<endl; 
}
};
int main() {
    marklist obj; 
    obj. getdata ();
    obj. getsub1();
    obj. getsub2();
    obj. getsub3();
    obj. display ();
    obj. getext();
    obj. disext();
    obj. calculation ();
    obj. totalmark();
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: