public Spectator GetNewSpectator() { int age = _r.Next(15, 65); int pol = _r.Next() % 2; Sex sex; if (pol == 1) { sex = Sex.Women; } else { sex = Sex.Men; } string f = _familia[_r.Next(0, _familia.Length)]; string i; string o; o = _menNames[_r.Next(0, _menNames.Length)]; if (sex == Sex.Men) { i = _menNames[_r.Next(0, _menNames.Length)]; if (o[o.Length - 1] == 'o') { o = o + "vych"; } else { o = o + "ovych"; } } else { i = _womenNames[_r.Next(0, _womenNames.Length)]; if (o[o.Length - 1] == 'o') { o = o + "vna"; } else { o = o + "ovna"; } } string fio = f + " " + i + " " + o; Spectator S = new Spectator(fio, age, sex); return(S); }
static void Main(string[] args) { SpectatorGenerator SG=new SpectatorGenerator(); Spectator[] S2 =new Spectator[100]; for (int i = 0; i < S2.Length; i++) { S2[i] = SG.GetNewSpectator(); } var F1 = new Film("Film", Genre.Action, 100, 50); var A1 = new Auditorium(1, F1, S2); Console.WriteLine(A1); Console.ReadKey(); }
static void Main(string[] args) { SpectatorGenerator SG = new SpectatorGenerator(); Spectator[] S2 = new Spectator[100]; for (int i = 0; i < S2.Length; i++) { S2[i] = SG.GetNewSpectator(); } var F1 = new Film("Film", Genre.Action, 100, 50); var A1 = new Auditorium(1, F1, S2); Console.WriteLine(A1); Console.ReadKey(); }
public Spectator GetNewSpectator() { int age = _r.Next(15, 65); int pol = _r.Next()%2; Sex sex; if (pol == 1) { sex=Sex.Women; } else { sex=Sex.Men;} string f = _familia[_r.Next(0, _familia.Length)]; string i; string o; o = _menNames[_r.Next(0, _menNames.Length)]; if (sex == Sex.Men) { i = _menNames[_r.Next(0, _menNames.Length)]; if (o[o.Length - 1]== 'o') { o = o + "vych"; } else { o = o + "ovych"; } } else { i = _womenNames[_r.Next(0, _womenNames.Length)]; if (o[o.Length - 1] == 'o') { o = o + "vna"; } else { o = o + "ovna"; } } string fio = f + " " + i + " " + o; Spectator S=new Spectator(fio,age,sex); return S; }
public Auditorium(int nomer, Film film, Spectator[] viewrs) { Numer = nomer; CurrentFilm = film; Viewers = viewrs; }