Advertisement
Adijata

RPR vježba 2, 1. b)

Oct 11th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1.    class Trener
  2.     {
  3.         string Ime;
  4.         string Prezime;
  5.         int _G_R;
  6.  
  7.         public Trener(string ime, string prezime, int GR)
  8.         {
  9.             this.Ime = ime;
  10.             this.Prezime = prezime;
  11.             this._G_R = GR;
  12.         }
  13.         public string ime
  14.         {
  15.             set
  16.             {
  17.                 if (value == null || value == string.Empty) throw new Exception("No name provided");
  18.                 else this.Ime = value;
  19.             }
  20.             get
  21.             {
  22.                 return this.Ime;
  23.             }
  24.         }
  25.        
  26.         public int GR
  27.         { set; get; }
  28.         public string prezime
  29.         {
  30.             set
  31.             {
  32.                 if (value == null || value == string.Empty) throw new Exception("No lastname provided");
  33.                 else this.Prezime = value;
  34.             }
  35.             get
  36.             {
  37.                 return this.Prezime;
  38.             }
  39.         }
  40.         public int GodineIskustva
  41.         {
  42.             set
  43.             {
  44.                 value++;
  45.             }
  46.             get
  47.             {
  48.                 return GodineIskustva;
  49.             }
  50.         }
  51.  
  52.  
  53.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement