Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Pracownik
- {
- private:
- string imie;
- string nazwisko;
- int wiek;
- char plec;
- public:
- Pracownik(string im = "Brak", string naz = "Brak", int w = 0, char p = 'n') : imie(im), nazwisko(naz), wiek(w), plec(p)
- {
- wyswietl();
- };
- wyswietl()
- {
- cout << "Imie: " << imie << endl;
- cout << "Nazwisko: " << nazwisko << endl;
- cout << "Wiek: " << wiek << endl;
- cout << "Plec: " << plec << endl;
- }
- };
- int main()
- {
- Pracownik piekarz;
- Pracownik kucharz("Jan", "Kowalski", 40, 'm');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement