Advertisement
JakubJaneczek

4

Oct 28th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. class Pracownik
  7. {
  8.     public:
  9.  
  10.     string imie;
  11.     string nazwisko;
  12.     int wiek;
  13.     char plec;
  14.  
  15.  
  16.     void show(){
  17.     cout<< "Twoje imie to....." <<  imie << endl;
  18.     cout<< "Twoje nazwisko to...." <<  nazwisko << endl;
  19.     cout<< "Twoj wiek to....." <<  wiek << endl;
  20.     cout<< "Twoja plec to....." <<  plec << endl;
  21.  
  22.     }
  23.     Pracownik (string n, string ln, int a, char s){
  24.         cout << "Kontruktor" << endl;
  25.         imie=n;
  26.         nazwisko=ln;
  27.         wiek=a;
  28.         plec=s;
  29.         show();
  30.     }
  31.  
  32. };
  33. int main()
  34. {
  35.     Pracownik p1("Kuba", "Kowalski", 34, 'm');
  36.     Pracownik p2();
  37.  
  38.  
  39.  
  40.  
  41.  
  42.     return 0;
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement