Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class samochod {
- public:
- string marka;
- string model;
- float pojemnosc;
- string kolor;
- int rok;
- float cena;
- samochod( string marka, string model, float pojemnosc, string kolor, int rok, float cena)
- {
- this->marka = marka;
- this->model = model;
- this->pojemnosc = pojemnosc;
- this->kolor = kolor;
- this->rok = rok;
- this->cena = cena;
- }
- };
- class wlasciciel: public samochod
- {
- public:
- string imie;
- string nazwisko;
- int pesel;
- string kod;
- string miejscowosc;
- wlasciciel( string marka, string model, float pojemnosc, string kolor, int rok, float cena,
- string imie, string nazwisko, int pesel, string kod, string miejscowosc):
- samochod(marka, model, pojemnosc, kolor, rok, cena)
- {
- this->imie = imie;
- this->nazwisko = nazwisko;
- this->pesel = pesel;
- this->kod = kod;
- this->miejscowosc = miejscowosc;
- }
- void wysw()
- {
- cout<<"Marka: "<<marka<<endl;
- cout<<"Model: "<<model<<endl;
- cout<<"Pojemnosc: "<<pojemnosc<<endl;
- cout<<"Kolor: "<<kolor<<endl;
- cout<<"Rok: "<<rok<<endl;
- cout<<"Cena: "<<cena<<endl;
- cout<<"*******************************************************"<<endl;
- cout<<"Imie: "<<imie<<endl;
- cout<<"Nazwisko: "<<nazwisko<<endl;
- cout<<"Pesel: "<<pesel<<endl;
- cout<<"Kod: "<<kod<<endl;
- cout<<"Miejscowosc: "<<miejscowosc<<endl;
- }
- };
- int main() {
- wlasciciel Osoba("Audi","A4",1.6,"Zielony",1998,2000,"Maciek", "Kowalski",2142148215,"39-473","shdjjf");
- Osoba.wysw();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement