pieniakoskar

Pracownicy

May 8th, 2018
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #include <conio.h>
  2. #include <stdio.h>
  3.  
  4. class Pracownik
  5. {
  6. unsigned short staz;
  7. unsigned int badanie;
  8. unsigned int BHP;
  9. unsigned short wyksztalcenie;
  10. protected:
  11. Pracownik(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w)
  12. : staz(s), badanie(b),BHP(BH)
  13. {
  14. if(w<6 && w>0)
  15. wyksztalcenie=w;
  16. }
  17. const void wyswietl() const
  18. {
  19. printf("Staz: %d\n", staz);
  20. printf("Rok wykonania kolejnego badania: %d\n", badanie);
  21. printf("Rok kolejnoego szkolenia BHP: %d\n", BHP);
  22. printf("Wyksztalcenie: %d\n", wyksztalcenie);
  23. }
  24. };
  25.  
  26. class PracownikAdministracji : public Pracownik
  27. {
  28. unsigned short nr_pokoju;
  29. protected:
  30. PracownikAdministracji(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w, const unsigned short n_p)
  31. : Pracownik(s,b,BH,w), nr_pokoju(n_p)
  32. {
  33. }
  34. const void wyswietl() const
  35. {
  36. Pracownik::wyswietl();
  37. printf("Numer pokoju: %d\n", nr_pokoju);
  38. }
  39. };
  40.  
  41. class Tlumacz : public PracownikAdministracji
  42. {
  43. unsigned int kod;
  44. public:
  45. Tlumacz(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w, const unsigned short n_p, const unsigned int k)
  46. : PracownikAdministracji(s,b,BH,w,n_p), kod(k)
  47. {
  48. }
  49. const void wyswietl() const
  50. {
  51. PracownikAdministracji::wyswietl();
  52. printf("Kod jezyka: %d\n",kod);
  53. }
  54. };
  55.  
  56. class Ksiegowy : public PracownikAdministracji
  57. {
  58. unsigned int szkolenie_ZUS;
  59. unsigned int szkolenie_KRUS;
  60. public:
  61. Ksiegowy(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w, const unsigned short n_p,const unsigned int s_z, const unsigned int s_k)
  62. : PracownikAdministracji(s,b,BH,w,n_p), szkolenie_ZUS(s_z), szkolenie_KRUS(s_k)
  63. {
  64. }
  65. const void wyswietl() const
  66. {
  67. PracownikAdministracji::wyswietl();
  68. printf("Rok odbycia szkolenia w ZUS: %d\n", szkolenie_ZUS);
  69. printf("Rok odbycia szkolenia w KRUS: %d\n", szkolenie_KRUS);
  70. }
  71.  
  72. };
  73.  
  74. int main()
  75. {
  76. Tlumacz t1(12,2012,2013,4,512,54902);
  77. Ksiegowy k1(15,2013,2013,6,321,2010,2010);
  78. t1.wyswietl();
  79. printf("------------------------\n");
  80. k1.wyswietl();
  81. _getch();
  82. return 0;
  83. }
Add Comment
Please, Sign In to add comment