Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include "Angestellte.h"
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. //1.)
  9. Angestellte A;
  10. strcpy( A.name, "Peter" ) ;
  11. A.gehalt = 38.000;
  12. A.geburtsjahr = 1956;
  13.  
  14. A.setEintrittsjahr(1978);
  15. cout << A.getEintrittsjahr()<<endl;
  16.  
  17. //2.)
  18. unsigned int n= 1;
  19. unsigned int j;
  20. Angestellte kartei[n];
  21. for(int i=0;i<n;i++){
  22. cout<<"Geben Sie die Daten fuer eine(n) Angestellte(n) ein:"<<endl;
  23. cout<<"Name: ";
  24. cin>>kartei[i].name;
  25. cout <<"Geburtsjahr : ";
  26. cin>>kartei[i].geburtsjahr;
  27. cout<<"Gehalt: ";
  28. cin >>kartei[i].gehalt;
  29. cout<<"Urlaubstage: ";
  30. cin>>kartei[i].urlaubstage;
  31. cout<<"Eintrittsjahr: ";
  32. unsigned int j;
  33. cin>>j;
  34. kartei[i].setEintrittsjahr(j);
  35. }
  36. for(int i=0;i<n;i++){
  37. unsigned int jubi=kartei[i].jubilaeum(2016);
  38. if(jubi!=0){
  39. cout<<kartei[i].name<<"\t"<<jubi<<" Jahre"<<endl;
  40. }
  41. }
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement