Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Pracownik
- {
- public:
- string imie;
- string nazwisko;
- int wiek;
- char plec;
- void show(){
- cout<< "Twoje imie to....." << imie << endl;
- cout<< "Twoje nazwisko to...." << nazwisko << endl;
- cout<< "Twoj wiek to....." << wiek << endl;
- cout<< "Twoja plec to....." << plec << endl;
- }
- void dopisz(string n, string ln, int a, char s) {
- imie=n;
- nazwisko =ln;
- if (a<=18){
- cout << "Błędny wiek pracownika" << endl;
- }
- else {
- cout << "Wszytsko w porządku" << endl;
- }
- plec =s;
- }
- };
- int main()
- {
- Pracownik p1;
- p1.imie="Kuba";
- p1.nazwisko="Kowalski";
- p1.wiek=19;
- p1.plec='m';
- p1.show();
- p1.dopisz("Kuba","Kubowski",20,'m');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement