Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class samochod {
  4. public:
  5. string marka;
  6. string model;
  7. float pojemnosc;
  8. string kolor;
  9. int rok;
  10. float cena;
  11.  
  12. samochod( string marka, string model, float pojemnosc, string kolor, int rok, float cena)
  13. {
  14. this->marka = marka;
  15. this->model = model;
  16. this->pojemnosc = pojemnosc;
  17. this->kolor = kolor;
  18. this->rok = rok;
  19. this->cena = cena;
  20. }
  21.  
  22.  
  23. };
  24.  
  25. class wlasciciel: public samochod
  26. {
  27. public:
  28. string imie;
  29. string nazwisko;
  30. int pesel;
  31. string kod;
  32. string miejscowosc;
  33.  
  34. wlasciciel( string marka, string model, float pojemnosc, string kolor, int rok, float cena,
  35. string imie, string nazwisko, int pesel, string kod, string miejscowosc):
  36. samochod(marka, model, pojemnosc, kolor, rok, cena)
  37. {
  38. this->imie = imie;
  39. this->nazwisko = nazwisko;
  40. this->pesel = pesel;
  41. this->kod = kod;
  42. this->miejscowosc = miejscowosc;
  43.  
  44. }
  45. void wysw()
  46. {
  47. cout<<"Marka: "<<marka<<endl;
  48. cout<<"Model: "<<model<<endl;
  49. cout<<"Pojemnosc: "<<pojemnosc<<endl;
  50. cout<<"Kolor: "<<kolor<<endl;
  51. cout<<"Rok: "<<rok<<endl;
  52. cout<<"Cena: "<<cena<<endl;
  53. cout<<"*******************************************************"<<endl;
  54. cout<<"Imie: "<<imie<<endl;
  55. cout<<"Nazwisko: "<<nazwisko<<endl;
  56. cout<<"Pesel: "<<pesel<<endl;
  57. cout<<"Kod: "<<kod<<endl;
  58. cout<<"Miejscowosc: "<<miejscowosc<<endl;
  59. }
  60. };
  61. int main() {
  62.  
  63. wlasciciel Osoba("Audi","A4",1.6,"Zielony",1998,2000,"Maciek", "Kowalski",2142148215,"39-473","shdjjf");
  64. Osoba.wysw();
  65.  
  66. system("pause");
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement