#include<iostream.h>
#include<conio.h>
class personal
{
private:
char name[20];
int age;
char sex;
public:
virtual void getdata();
virtual void display();
};
class academic : public personal
{
private:
char name[20];
char trade[20];
int rollno;
public:
void getdata();
void display();
};
void personal :: getdata()
{
cout<<"(virtual function)***Enter the data***"<<endl;
cout<<"Name : ";
cin>>name;
cout<<"Age : ";
cin>>age;
cout<<"Sex : ";
cin>>sex;
}
void personal :: display()
{
cout<<"***The entered data is***" <<endl;
cout<<"Name : "<<name<<endl;
cout<<"Age : "<<age<<endl;
cout<<"Sex : "<<sex<<endl;
}
void academic :: getdata()
{
cout<<" (member function of class academic called) "<<endl;
cout<<"***Enter the data***"<<endl;
cout<<"Name : ";
cin>>name;
cout<<"Trade : ";
cin>>trade;
cout<<"Rollno : ";
cin>>rollno;
}
void academic :: display()
{
cout<<"***The entered data is***" <<endl;
cout<<"Name : "<<name<<endl;
cout<<"Trade : "<<trade<<endl;
cout<<"Rollno : "<<rollno<<endl;
}
int main()
{
class personal *ptr;
class academic obj;
ptr = &obj;
clrscr();
ptr -> getdata();
ptr -> display();
getch();
return 0;
}
SiteMap
|
Link Us
...Language...
English
French
German
Hindi
Italian
Russian
Japanese
Chinese
Home
|
About Us
|
Portfolio
|
Services
|
Career
|
Contact Us
|
Industrial Training
|
Achievement
Corporate Services
Web Design and development
Web Promotion (SEO)
Multimedia/CD Presentation
Software development
E.Commerce
Training@balujalabs
Software Courses
Hardware Courses
Networking.Courses
Mobile Repairing Courses
UGC Degrees
Student Corner
Programming & Projects
Placement Papers
Project Ideas
Synopsis Ideas
Franchise Section
Administrator
Franchise Inquiry
To demonstrate the concept of polymorphism applied to the member functions
1
To demonstrate the operations of static binding of the member function of the class.
2
To demonstrate the use of virtual function with the help of pointers.
3
To demonstrate the use of virtual function with inline substitution.
4
To demonstrate the operation of late binding of member function of a class.
5
To apply the arithmetic operations (+, *) on the given integers through various functions based on static binding.
6
To apply the arithmetic operations (+, *) on the given integers through various functions based on late binding.
7
To demonstrate the concept of polymorphism applied to the member functions
8
To illustrate the operation of a pure virtual function having function definition outside the class.
9
To illustrate the operation of pure function having function declared and defined inside the class definition.
10
To demonstrate multiple inheritance without using virtual classes.
11
To demonstrate multiple inheritances without base classes.
12
Write a program to enter information of a student and display it by using the static binding technique.
13
.Write a program to enter information of an employee and display it by using the late binding technique.
14
Write a program to demonstrate the operation of virtual function using late binding technique.
15
Write a program to demonstrate the pure virtual functions.
16
Write a program to demonstrate the operation of virtual base classes.
Home
|
About Us
|
Portfolio
|
Services
|
Career
|
Contact Us
|
Industrial Training
|
Achievement