Advertisement
Guest User

Osoba

a guest
Oct 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace OOP
  8. {
  9. class Osoba
  10. {
  11. public string Imie
  12. {
  13. get;
  14. private set;
  15. }
  16. public string Nazwisko
  17. {
  18. get;
  19. private set;
  20. }
  21. public Adres AdresZamieszkania
  22. {
  23. get;
  24. private set;
  25. }
  26. public string PrzedstawSię()
  27. {
  28. return "Nazywam się " + this.Imie + ' ' + this.Nazwisko + '\n' + this.AdresZamieszkania.AdresWFormaciePocztowym + '\n';
  29. }
  30.  
  31. public void UstawDane(string noweImie, string noweNazwisko, string nowaUlica, string nowyNumerDomu, string nowyNumerMieszkania, string nowyKodPocztowy,
  32. string noweMiasto, string nowePaństwo)
  33. {
  34. this.Imie = noweImie;
  35. this.Nazwisko = noweNazwisko;
  36. AdresZamieszkania = new Adres();
  37. AdresZamieszkania.UstawDane(nowaUlica, nowyNumerDomu, nowyNumerMieszkania, nowyKodPocztowy, noweMiasto, nowePaństwo);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement