Guest User

Untitled

a guest
Dec 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class employee
  5. {
  6. char name[20];
  7. char ID[20];
  8. float salary;
  9. char jdate[20];
  10. public:
  11. employee();
  12. employee(float x);
  13. void input();
  14. void display();
  15. friend void compare(employee a, float x);
  16. };
  17.  
  18. void employee::input()
  19. {cin>>name>>ID>>salary>>jdate;
  20. }
  21.  
  22. employee::employee()
  23. {
  24. salary=5000;
  25. }
  26.  
  27. employee::employee(float x)
  28. {
  29. salary=x;
  30. }
  31.  
  32. void employee::display()
  33. {
  34. cout<<"\n Display Info:";
  35. cout<<"Name:"<<name<<"\t ID:"<<ID<<"\t Salary:"<<salary<<"\t Joining Date:"<<jdate;
  36. }
  37.  
  38. void compare(employee a, float x)
  39. {
  40. if(a.salary>x)
  41. {
  42. cout<<"\n Large Amount Of Salary";
  43. }
  44. }
  45.  
  46. int main()
  47. {
  48. int i;
  49. employee list[11];
  50. for(i=0;i<10;i++)
  51. {
  52. list[i].input();
  53. }
  54. for(i=0;i<10;i++)
  55. {
  56. list[i].display();
  57. }
  58. for(i=0;i<10;i++)
  59. {
  60. compare(list[i],90000);
  61. }
  62. return 0;
  63. }
Add Comment
Please, Sign In to add comment