C++ program using class to generate mark sheet using multiple inheritance

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Using multiple inheritances, prepare a Student Mark sheet, class marks for every student in three subjects. The inherited class generates mark sheet.

#include<iostream.h>
#include<stdio.h>
#include<dos.h>
class student 
{
	int roll;
	char name[25];
	char add [25];
	char *city;
	public: student()
	{
		cout<<"welcome in the student information system"<<endl;
	}
	void getdata()
	{
		cout<<"\n enter the student roll no.";
		cin>>roll;
		cout<<"\n enter the student name";
		cin>>name;
		cout<<\n enter ther student address";
		cin>>add;
		cout<<"\n enter the student city";
		cin>>city;
	}
	void putdata()
	{
		cout<,"\n the student roll no:"<<roll;
		cout<<"\n the student name:"<<name;
		cout<<"\n the student coty:"<<city;
	}
};
class mrks: public student
{
	int sub1;
	int sub2;
	int sub3;
	int per;
	public: void input()
	{
		getdata();
		cout<<"\n enter the marks1:"
		cin>>sub1:
		cout<<"\n enter the marks2:";
		cin>>sub2;
		cout<<\n enter the marks3:";
		cin>>sub3;
	}
	void output()
	{
		putdata();
		cout<<"\n marks1:"<<sub1;
		cout<<"\n marks2:"<<sub2;
		cout<<"\n marks3:"<<sub3;
	}
	void calculate ()
	{
		per= (sub1+sub2+sub3)/3;
		cout<<"\n tottal percentage"<<per;
	}
};
 
void main()
{
	marks m1[25];
	int ch;
	int count=0;
	do 
	{
		cout<<\n1.input data";
		cout<<\n2.output data";
		cout<<\n3. Calculate percentage";
		cout<<\n4.exit";
		cout<<\n enter the choice";
		cin>>ch;
		switch (ch)
		{
			case 1:
			m1.input();
			count++;
			break;
 
                        case2:
			m1.output();
			break;
 
			case3:
			m1.calculate();
			break;
		}
	} while (ch!=4);
}

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

20 Responses to “C++ program using class to generate mark sheet using multiple inheritance”

  1. #include
    #include
    int add(int a,int b);
    int subtract(int a, int b);
    int multi(int a,int b);
    int divide(int a,int b);
    int main()
    {
    char choise;
    int a,b;
    cout<<"1.Add\n";
    cout<<"2.Subtraction\n";
    cout<<"3.Multiply\n";
    cout<>a;
    cin>>choise;
    switch(choise)
    {
    case ‘+’:
    cin>>b;
    cout<>b;

    cout<>b;
    cout<>b;
    cout<<divide(a,b);
    break;

    default :
    cout<<"Choise correct Key\n";
    break;
    }

    getch();
    return 0;
    }
    int add(int x,int y)
    {
    int z;
    z=x+y;
    return z;
    }
    int subtarct(int x,int y)
    {
    int z;
    z=x-y;
    return z;
    }
    int multi(int x,int y)
    {
    int z;
    z=x*y;
    return z;
    }
    int divide(int x,int y)
    {
    int z;
    z=x/y;
    return z;
    }

    Reply
  2. Its a very simple concept and also a simple program.You need not complite this way and make it very tough for the people who look into it.

    Reply
  3. Its a very simple concept and also a simple program.You need not complicate this way and make it very tough for the people who look into it.

    Reply
  4. Its a very simple concept and also a simple program.You need not complicate it this way and make it very tough for the people who look into it.

    Reply
  5. aiswarya

    this program will show error as unterminated string
    & please include output

    Reply
  6. #include
    #include
    class er
    {
    int a;
    static int b;

    public:
    void rr(int e, int s)
    {
    e=a;
    s=b;

    }

    };
    void cl()
    {
    b=b*b;
    }
    void sh()
    {
    cout<<a<<"\n"<<b;
    }

    void inp()
    {
    cout<>a>>b;

    }

    void main()

    {
    clrscr();
    void inp();
    void show();
    void cl();
    void show();
    getch();
    }

    Reply
  7. Hi
    I’m a form 4 student who is trying to create an electronic marksheet
    Its very hard
    Can you please help me?

    Reply
  8. i want to make a program to show 3 students info,add info,delete info,show info can u help me....

    please help me

    Reply

Leave a Reply