#include<iostream.h>
#include<conio.h> // for clrscr()
const int LEN = 25;
class Employee
{
private :
char name[LEN];
unsigned long enumb;
public :
void getdata()
{
cout<<"Enter Name : ";
cin.getline(name, LEN);
cout<<"Enter Employee Number : ";
cin>>enumb;
}
void putdata()
{
cout<<"Name : "<<name<<"\t";
cout<<"Emp. Number : "<<enumb<<"\t";
cout<<"Basic Salary : "<<basic;
}
protected:
float basic;
void getbasic()
{
cout<<"Enter Basic : ";
cin>>basic;

}
};
class Manager : public Employee
{
private:
char title[LEN];
public:
void getdata()
{
Employee :: getdata(); // To resolve identity as
// Manager also has a getdata()
getbasic();
char ch=cin.get();
cout<<"Enter Title :";
cin.getline(title,LEN);
cout<<"\n";
}
void putdata()
{
Employee :: putdata();
cout<<"\nTitle:"<<title<<"\n";
}
};
int main()
{
clrscr();
Manager m1, m2;
cout<<"Manager1\n";
m1.getdata();
cout<<"Manager2\n";
m2.getdata();
cout<<"The entered records are ...\n";
cout<<"\t\tManager1 Details\n";
m1.putdata();
cout<<"\t\tManager2 Details\n";
m2.putdata();
getch();
return 0;
}

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 C++ program to read and display information about employees and managers. Employee is the base class and Manager is the sub class.

 

 

 

 

 

 

 

 

 

                                                                                                                                          

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