Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Person
- {
- public string Name;
- public string Surname;
- private int _birthDay;
- public int BirthDay
- {
- get { return (2017 - _birthDay); }
- set { _birthDay = value; }
- }
- public Person(string name, string surname, int birthday)
- {
- this.Name = name;
- this.Surname = surname;
- BirthDay = birthday;
- }
- public override string ToString()
- {
- return string.Format("Imie: {0}\n Nazwisko: {1}\n Wiek: {2} ", Name, Surname, BirthDay);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement