OOPS Design an employee class for reading and displaying the employee information, the getInfo() and displayInfo() methods will be used repectively. Where getInfo() will be private method - BSC IT PRACTICALS

Thursday, January 18, 2018

OOPS Design an employee class for reading and displaying the employee information, the getInfo() and displayInfo() methods will be used repectively. Where getInfo() will be private method


CODE:

# include <iostream.h>
# include <conio.h>
class employee
{
private:
int emp_id;
char emp_name[30];
double salary;
void getinfo()
{
cout<<"Enter Name"<<endl;
cin>>emp_name;
cout<<"Enter ID"<<endl;
cin>>emp_id;
cout<<"Enter salary"<<endl;
cin>>salary;
}

public:
void displayinfo()
{
getinfo();
cout<<endl<<"THE INFORMATION ENTERED IS :"<<endl;
cout<<"Name is "<<emp_name<<endl;
cout<<"ID is "<<emp_id<<endl;
cout<<"Your salary is "<<salary<<endl;
}
};
void main()
{
clrscr();
employee e1;
e1.displayinfo();

getch();
}


1 comment:

  1. Gambling and Casino in Las Vegas - DrmCD
    The casino in Las 보령 출장안마 Vegas is located in the heart of 서산 출장샵 the Strip. The casino is a hotel and casino that was built in 1929. 세종특별자치 출장안마 The property has been 정읍 출장마사지 occupied 대구광역 출장샵 by

    ReplyDelete