Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class employee
- {
- char name[20];
- char ID[20];
- float salary;
- char jdate[20];
- public:
- employee();
- employee(float x);
- void input();
- void display();
- friend void compare(employee a, float x);
- };
- void employee::input()
- {cin>>name>>ID>>salary>>jdate;
- }
- employee::employee()
- {
- salary=5000;
- }
- employee::employee(float x)
- {
- salary=x;
- }
- void employee::display()
- {
- cout<<"\n Display Info:";
- cout<<"Name:"<<name<<"\t ID:"<<ID<<"\t Salary:"<<salary<<"\t Joining Date:"<<jdate;
- }
- void compare(employee a, float x)
- {
- if(a.salary>x)
- {
- cout<<"\n Large Amount Of Salary";
- }
- }
- int main()
- {
- int i;
- employee list[11];
- for(i=0;i<10;i++)
- {
- list[i].input();
- }
- for(i=0;i<10;i++)
- {
- list[i].display();
- }
- for(i=0;i<10;i++)
- {
- compare(list[i],90000);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment