Advertisement
Guest User

Untitled

a guest
Apr 12th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.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 JesperLeg
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Kunde kunde = new Kunde(1, "Haddock", "Kajplads 17", "test1", 6000, "Kolding", "[email protected]", 12345678, 1000.25);
  14.  
  15. Console.WriteLine("Kunde Nr: {0}", kunde.Getnr());
  16. Console.WriteLine("Kunde Navn: {0}", kunde.GetNavn());
  17. kunde.SetNavn("Kaptajn Archibald Haddock");
  18. Console.WriteLine("Lulwut " + kunde.Tlfnr());
  19. Console.ReadLine();
  20. }
  21. }
  22.  
  23. public class Kunde
  24. {
  25. private readonly int nr;
  26. private string navn;
  27. private string adresse1;
  28. private string adresse2;
  29. private int postnr;
  30. private string by;
  31. private string email;
  32. private readonly int _tlfnr;
  33. private readonly double _saldo;
  34.  
  35. public Kunde(int nr, string navn, string adresse1, string adresse2, int postnr, string by, string email,
  36. int _tlfnr, double _saldo)
  37. {
  38. this.nr = nr;
  39. this.navn = navn;
  40. this.adresse1 = adresse1;
  41. this.adresse2 = adresse2;
  42. this.postnr = postnr;
  43. this.by = by;
  44. this.email = email;
  45. this._tlfnr = _tlfnr;
  46. this._saldo = _saldo;
  47.  
  48. }
  49. public int Getnr()
  50. {
  51. return nr;
  52. }
  53. public string GetNavn()
  54. {
  55. return navn;
  56. }
  57. public void SetNavn(string navn)
  58. {
  59. this.navn = navn;
  60. }
  61. public string GetAdresse1()
  62. {
  63. return adresse1;
  64. }
  65. public void SetAdresse1(string adresse1)
  66. {
  67. this.adresse1 = adresse1;
  68. }
  69. public string GetAdresse2()
  70. {
  71. return adresse2;
  72. }
  73. public void SetAdresse2(string adresse2)
  74. {
  75. this.adresse2 = adresse2;
  76. }
  77. public int GetPostnr()
  78. {
  79. return postnr;
  80. }
  81. public void SetPostnr(int postnr)
  82. {
  83. this.postnr = postnr;
  84. }
  85. public string GetBy()
  86. {
  87. return by;
  88. }
  89. public void SetBy(string by)
  90. {
  91. this.by = by;
  92. }
  93. public string GetEmail()
  94. {
  95. return email;
  96. }
  97. public void SetEmail(string email)
  98. {
  99. this.email = email;
  100. }
  101. public int Tlfnr()
  102. {
  103. return _tlfnr;
  104. }
  105. public double Saldo()
  106. {
  107. return _saldo;
  108. }
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement