#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class base
{
protected:
char a[10];
public:
void input();
void output();
};
class derive1 : public virtual base
{
protected:
float c, d;
public:
void input();
void output();
};
class derive2 : public virtual base
{
protected:
int e, f;
public:
void input();
void output();
};
class derive3 : public derive1, public derive2
{
public:
void input();
void output();
};
void base :: input()
{
cout<<"Enter any string : ";
gets(a) ;
}
void base :: output()
{
cout<<"The entered string is : "<<endl<<a<<endl;
}
void derive1 :: input()
{
base :: input();
cout<<"Enter any two float numbers : ";
cin>>c>>d;
}
void derive1 :: output()
{
base :: output();
cout<<"The entered float numbers are : "<<endl<<c<<endl<<d<<endl;
}
void derive2 ::input()
{
base :: input();
cout<<"Enter any two integers : ";
cin>>e>>f;
}
void derive2 :: output()
{
base :: output();
cout<<"The entered integers are : "<<endl<<e<<endl<<f<<endl;
}
void derive3 :: input()
{
derive1 :: input();
derive2 :: input();
}
void derive3 :: output()
{
derive1 :: output();
derive2 :: output();
}
int main()
{
class derive3 obj ;
clrscr();
obj.input();
obj.output();
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
Write a program to demonstrate the operation of virtual base classes.
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