Advertisement
MeehoweCK

Untitled

Jan 7th, 2021
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Rekord
  6. {
  7. protected:
  8.     string nazwa;
  9. public:
  10.     Rekord(string tytul) : nazwa(tytul) {}
  11. };
  12.  
  13. class film : public Rekord      // public Rekord informuje kompilator, że klasa ta dziedziczy od klasy Rekord (jest jej klasą pochodną)
  14. {
  15.     string rezyser, gatunek;
  16.     int rok_produkcji;
  17. public:
  18.     film(string director, string tytul, string rodzaj, int rok) : Rekord(tytul), rezyser(director), gatunek(rodzaj), rok_produkcji(rok) {}
  19. };
  20.  
  21. class czasopismo : public Rekord
  22. {
  23.     int numer;
  24. };
  25.  
  26. class ksiazka : public Rekord
  27. {
  28.     string wydawnictwo, autor, miasto_wydania;
  29.     int ilosc_stron, rok_wydania;
  30. };
  31.  
  32. int main()
  33. {
  34.  
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement