14VRTBCL - cout<<"Score"<<score class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # class student { protected: int rn; public: void getn(int a) { rn=a; } void putn() { cout<<rn<<endl; } }; } class test:virtual public student { protected: int m1,m2; public: void getm(int x,int y) { m1=x; m2=y; } void putm() { cout<<m1<<m2<<endl; } }; } class sports:public virtual student { protected: float score; public: void getsc(float s) { score=s; } void putsc()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { cout<<"Score"<<score; } }; } class result:public test,public sports { float total; public: void display(); }; } void result::display() { total=m1+m2+score; putn(); putm(); cout<<"Total "<<total<<endl; } void main() { clrscr(); result s1; s1.getn(2); s1.getm(8,9); s1.getsc(7.5); s1.display(); getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Fall '06 term at University of Mumbai.

Page1 / 2

14VRTBCL - cout<<"Score"<<score class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online