Page 197 - DCAP404 _Object Oriented Programming
P. 197
Object-oriented Programming
Notes class sports:virtual public student
{
protected:
char sname[20];
int smarks;
};
class result:public exam, public sports
{
private:
int tmarks;
public:
void input();
void total();
void display();
};
void result::input()
{
cout<<“enter enroll:”;
cin>>enroll;
cout<<“enter name:”;
cin>>name;
cout<<“enter course:”;
cin>>course;
cout<<“enter exam type:”;
cin>>etype;
cout<<“enter marks of subject1:”;
cin>>msub1;
cout<<“enter marks of subject2:”;
cin>>msub2;
cout<<“enter marks of subject3:”;
cin>>msub3;
cout<<“enter sports name:”;
cin>>sname;
cout<<“enter sports marks:”;
cin>>smarks;
190 LOVELY PROFESSIONAL UNIVERSITY