Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- #include <stdio.h>
- class Pracownik
- {
- unsigned short staz;
- unsigned int badanie;
- unsigned int BHP;
- unsigned short wyksztalcenie;
- protected:
- Pracownik(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w)
- : staz(s), badanie(b),BHP(BH)
- {
- if(w<6 && w>0)
- wyksztalcenie=w;
- }
- const void wyswietl() const
- {
- printf("Staz: %d\n", staz);
- printf("Rok wykonania kolejnego badania: %d\n", badanie);
- printf("Rok kolejnoego szkolenia BHP: %d\n", BHP);
- printf("Wyksztalcenie: %d\n", wyksztalcenie);
- }
- };
- class PracownikAdministracji : public Pracownik
- {
- unsigned short nr_pokoju;
- protected:
- PracownikAdministracji(const unsigned short s,const unsigned int b,const unsigned int BH,const unsigned short w, const unsigned short n_p)
- : Pracownik(s,b,BH,w), nr_pokoju(n_p)
- {
- }
- const void wyswietl() const
- {
- Pracownik::wyswietl();
- printf("Numer pokoju: %d\n", nr_pokoju);
- }
- };
- class Tlumacz : public PracownikAdministracji
- {
- unsigned int kod;
- public:
- 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)
- : PracownikAdministracji(s,b,BH,w,n_p), kod(k)
- {
- }
- const void wyswietl() const
- {
- PracownikAdministracji::wyswietl();
- printf("Kod jezyka: %d\n",kod);
- }
- };
- class Ksiegowy : public PracownikAdministracji
- {
- unsigned int szkolenie_ZUS;
- unsigned int szkolenie_KRUS;
- public:
- 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)
- : PracownikAdministracji(s,b,BH,w,n_p), szkolenie_ZUS(s_z), szkolenie_KRUS(s_k)
- {
- }
- const void wyswietl() const
- {
- PracownikAdministracji::wyswietl();
- printf("Rok odbycia szkolenia w ZUS: %d\n", szkolenie_ZUS);
- printf("Rok odbycia szkolenia w KRUS: %d\n", szkolenie_KRUS);
- }
- };
- int main()
- {
- Tlumacz t1(12,2012,2013,4,512,54902);
- Ksiegowy k1(15,2013,2013,6,321,2010,2010);
- t1.wyswietl();
- printf("------------------------\n");
- k1.wyswietl();
- _getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment