#include<iostream.h>
#include<conio.h>
class personal
{
private :
int rollno;
char name[20];
char sex;
public:
void getdata ();
void putdata () ;
};
class physical : public personal
{
private :
float height;
float weight;
public:
void getdata();
void putdata() ;
};
class academic : public physical
{
private:
char trade[20];
int semes;
public:
void getdata();
void putdata() ;
};
void personal :: getdata ()
{
cout<<"Student's name : ";
cin>>name;
cout<<"Rollno : ";
cin>>rollno;
cout<<"Sex : " ;
cin>>sex;
}
void personal :: putdata ()
{
cout<<"Student's name : "<<name<<endl;
cout<<"Rollno : "<<rollno<<endl;
cout<<"Sex : " <<sex<<endl;
}
void physical :: getdata()
{
personal :: getdata();
cout<<"Height : ";
cin>>height;
cout<<"Weight : ";
cin>>weight;
}
void physical :: putdata()
{
personal :: putdata();
cout<<"Height : "<<height<<endl;
cout<<"Weight : "<<weight<<endl;
}
void academic :: getdata()
{
personal :: getdata();
cout<<"Trade : ";
cin>>trade;
cout<<"Semester : ";
cin>>semes;
}
void academic :: putdata()
{
personal :: putdata();
cout<<"Trade : "<<trade<<endl;
cout<<"Semester : "<<semes<<endl;
}
int main()
{
class academic obj1;
int n, i;
clrscr();
cout<<"How many records to enter : ";
cin>>n;
for(i=0; i<=n-1; i++);
{
cout<<endl<<"Record No. "<<i+1<<endl;
obj.getdata();
}
cout<<endl<<"***The entered record are ***";
for(i=0; i<=n-1; i++);
{
cout<<endl<<"Record No. "<<i+1<<endl;
obj1.putdata();
}
return 0;
getch();
}
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
 
 

Program to enter the information of x number of student and display it using the multilevel inheritance concept.

 

 

 

 

 

 

 

 

 

                                                                                                                                          

1 Program to enter the information of an employee and then display it using the single inheritance concept (one base class and one derived class).
2 Program to enter the information of a student and then display it using the single inheritance concept.
3 Program to enter the information of x number of student and display it using the multilevel inheritance concept.
4 Program using multilevel inheritance to get the data from two base classes and display it using the derived class.
5 Program to demonstrate the use of nested classes taking example of train information.
6 Write a C++ program to read and display information about employees and managers. Employee is the base class and Manager is the sub class.
7 The following incomplete program takes information about students and their marks and their displays their result. Complete it by filling up their blanks (Grade is ‘A’ for percentage>=60.00, ‘B’ for 50-55.99 ‘C’ for 40-49.99 and ‘D’ for<40).
8 A railway reservation counter needs to computerize its reservation process. Using the following information write C++ Program to do so.

 

     
Home       |      About Us       |     Portfolio       |      Services       |       Career        |    Contact Us       |      Industrial Training        |      Achievement