Idea Solution CS304View more random threads:
- Cocoa Production Supply Assignment April 2013
- ENG001 Elementary English Assignment No 1 semester Fall 3rd...
- Knowledge Management (MGT630) ASSIGNMENT No. 01 May6, 2010
- CS304 Solution 2nd Assignment Spring 2010 May 4
- Solution of MTH101's Assignment No 6 Fall 2010
- CS507-Information Systems Assignment No 01 fall semester...
- CS101 - Introduction to Computing Assignment No. 01 Fall...
- PSY405 Personality Psychology Assignment No. 01 Solution...
- MGMT628 Assignment 2 Solution June 2010
- Assignment # 01(MTH 101)
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)