Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public const int MIN_POSTCODE = 1000;
- public const int MAX_POSTCODE = 9999;
- public string Naam { get; set; }
- public string Achternaam { get; set; }
- public DateTime Geboortedatum { get; set; }
- private int postcode;
- public int Postcode
- {
- get { return postcode; }
- set {
- if (value <= MAX_POSTCODE && value >= MIN_POSTCODE)
- {
- postcode = value;
- }
- else
- {
- postcode = MIN_POSTCODE;
- }
- }
- }
- public Koper(string naam, string achternaam, DateTime geboortedatum, int postcode)
- {
- Naam = naam;
- Achternaam = achternaam;
- this.Geboortedatum = geboortedatum;
- Postcode = postcode;
- }
- public override string ToString()
- {
- return ("Voornaam: " + Naam + "\nAchternaam: " + Achternaam + "\nGeboortedatum: " + Geboortedatum + "\nPostcode: " + Postcode);
- }
Advertisement
Add Comment
Please, Sign In to add comment