Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 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 IdIdentification
  8. {
  9. class persoana
  10. {
  11. //campuri
  12. private string Nume, Prenume, Cnp, Sex;
  13. private int varsta;
  14. //constructori
  15. public persoana(string nume, string prenume, string cnp)
  16. {
  17. Nume = nume;
  18. Prenume = prenume;
  19. Cnp = cnp;
  20. Age = 2;
  21. }
  22. //functii
  23. public string S
  24. {
  25. set
  26. {
  27. char[] aux = Cnp.ToCharArray();
  28. char x = aux[0];
  29. if (x == '1' || x == '5') S="m";
  30. else S="f";
  31. }
  32. get
  33. {
  34. return Sex;
  35. }
  36. }
  37. public int Age
  38. {
  39. set
  40. {
  41. char[] x = Cnp.ToCharArray();
  42.  
  43. }
  44. get
  45. {
  46. return varsta;
  47. }
  48. }
  49. public void afisare()
  50. {
  51. Console.WriteLine(Nume + " " + Prenume + " " + Cnp + " " + Age + " " + S);
  52. }
  53.  
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement