Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 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 ConsoleApp1
  8. {
  9. class Person
  10. {
  11. public string Name;
  12. public string Surname;
  13. private int _birthDay;
  14.  
  15. public int BirthDay
  16. {
  17. get { return (2017 - _birthDay); }
  18. set { _birthDay = value; }
  19. }
  20. public Person(string name, string surname, int birthday)
  21. {
  22. this.Name = name;
  23. this.Surname = surname;
  24. BirthDay = birthday;
  25. }
  26. public override string ToString()
  27. {
  28. return string.Format("Imie: {0}\n Nazwisko: {1}\n Wiek: {2} ", Name, Surname, BirthDay);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement