Idea Solution CS304View more random threads:
- Assignment No. 01 Spring 2015 Information Systems CS507...
- CS615 Assignment 5 Deadline 22 July 2010
- CS201 Solution 2nd Assignment Spring 2010 May 4
- PSY404 Abnormal Psychology Assignment Solution Fall...
- fin621 assignment solution
- PHY101 - Physics Assignment No. 03 Discussion Fall 2013
- Advanced Computer Architecture CS501 Solution of Assignment...
- Managerial Economics - Eco404 Assignment No.1 Solution Fall...
- CS504 Solution idea May 19,2010
- CS610 Computer Networks Assignment No 3 Solution Fall...
Sponsored Links
Code:#include<iostream.h> #include<conio.c> //Employee class definition class Employee { public: Employee(){} //pure virtual method virtual void DisplayName()=0; }; //Salaried Employee class definition class SalariedEmployee:public Employee { public: SalariedEmployee(){} //overriden DisplayName virtual void DisplayName(){ cout<<"This is Salaried Employee"<<endl;} }; //Commission Employee class definition class CommissionEmployee:public Employee { public: CommissionEmployee(){} //overriden displayName virtual void DisplayName(){ cout<<"This is Commission Employee"<<endl;} }; void main() { //pointer to Employee declaration Employee *obj; //polymorphically call of DisplayName of Salaried Employee obj = new SalariedEmployee(); obj->DisplayName(); //Polymorphically call of DisplayName of Commission Employee obj= new CommissionEmployee(); obj->DisplayName(); getch(); }
:o:o--------------------------------------------------------------------------------------:o:o
[B]The more knowledge you have, the greater will be your fear of Allah.[/B]
Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
[B]http://vuhelp.net/groups/birthday-wishing.html[/B]
[B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
[CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]
There are currently 1 users browsing this thread. (0 members and 1 guests)