public c_Wlasciciel(c_Wlasciciel wl) { this.imie = wl.imie; this.nazwisko = wl.nazwisko; this.adres = wl.adres; this.pesel = wl.pesel; this.nr_prawa_jazdy = wl.nr_prawa_jazdy; this.data_uzyskania_prawa_jazdy = wl.data_uzyskania_prawa_jazdy; this.rok_zakupu = wl.rok_zakupu; this.punkty_karne = wl.punkty_karne; }
static void Main(string[] args) { Console.WriteLine("Cwiczenie 1\n"); c_Pojazd pojazd1 = new c_Pojazd("van", "IVECO", 1.6, 3, "123456", "rejestr1", 2015, "biały", "12124"); c_Wlasciciel wlasciciel1 = new c_Wlasciciel("Janusz", "Nosacz", "Kwiatowa 6", "527152671", "2164d", "12,12,12", 2016, 3); c_Pojazd pojazd2 = new c_Pojazd("SUV", "TOYOTA", 3.6, 5, "7854397", "rej2", 2014, "Czarny", "73hofwe"); c_Wlasciciel wlasciciel2 = new c_Wlasciciel("Beata", "Plizga", "Nowa 3", "89273508247", "wid9", "15.15.15", 2018, 17); c_Pojazd pojazd3 = new c_Pojazd("GIT", "Citroen", 1.6, 5, "2452r23r", "rej3", 2005, "srebrny", "397ery390"); c_Wlasciciel wlasciciel3 = new c_Wlasciciel("Gabriel", "Kowal", "Stara 7", "93278yr9", "f387y", "15.16.17", 2015, 0); Auto[] samochody = new Auto[3]; samochody[0] = new Auto(pojazd1, wlasciciel1); samochody[1] = new Auto(pojazd2, wlasciciel2); samochody[2] = new Auto(pojazd3, wlasciciel3); IPoliceData[] police = new IPoliceData[3]; police[0] = samochody[0]; police[1] = samochody[1]; police[2] = samochody[2]; ICepikData[] cepik = new ICepikData[3]; cepik[0] = samochody[0]; cepik[1] = samochody[1]; cepik[2] = samochody[2]; IStatData[] stat = new IStatData[3]; stat[1] = samochody[1]; stat[2] = samochody[2]; stat[0] = samochody[0]; for (int i = 0; i < 3; i++) { Console.WriteLine(police[i].get_user_punkty_karne()); Console.WriteLine(cepik[i].get_user_imie()); Console.WriteLine(stat[i].get_car_marka() + "\n"); } }
public Auto(c_Pojazd poj, c_Wlasciciel wl) { pojazd = new c_Pojazd(poj); wlasciciel = new c_Wlasciciel(wl); }