KatarzynaBracha

2.klasy_c++

Oct 5th, 2020 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Student
  6. {
  7.     public:
  8.     string imie;
  9.     string nazwisko;
  10.     int wiek;
  11.  
  12.     void wyswietl();
  13.  
  14.  
  15.     private:
  16.     long long int pesel;
  17.     string nr_dowodu;
  18. };
  19.  
  20.  
  21.    void Student::wyswietl()
  22.     {
  23.     cout<<"Student"<<imie<<" "<<nazwisko<<endl;
  24.     }
  25.  
  26. int main()
  27. {
  28.     Student osoba1;
  29.  
  30.     osoba1.imie="Kasia";
  31.     osoba1.nazwisko="Bracha";
  32.     osoba1.wiek=23;
  33.  
  34.     osoba1.wyswietl();
  35.  
  36.  
  37.     return 0;
  38. }
  39.  
Add Comment
Please, Sign In to add comment