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 IdIdentification
- {
- class persoana
- {
- //campuri
- private string Nume, Prenume, Cnp, Sex;
- private int varsta;
- //constructori
- public persoana(string nume, string prenume, string cnp)
- {
- Nume = nume;
- Prenume = prenume;
- Cnp = cnp;
- Age = 2;
- }
- //functii
- public string S
- {
- set
- {
- char[] aux = Cnp.ToCharArray();
- char x = aux[0];
- if (x == '1' || x == '5') S="m";
- else S="f";
- }
- get
- {
- return Sex;
- }
- }
- public int Age
- {
- set
- {
- char[] x = Cnp.ToCharArray();
- }
- get
- {
- return varsta;
- }
- }
- public void afisare()
- {
- Console.WriteLine(Nume + " " + Prenume + " " + Cnp + " " + Age + " " + S);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement