static void Main(string[] args) { Pupil[] pupil = new Pupil[4]; pupil[0] = new GoodPupil(); pupil[1] = new BadPupil(); pupil[2] = new ExcelentPupil(); pupil[3] = new BadPupil(); ClassRoom classRoom = new ClassRoom(pupil[1], pupil[0]); classRoom.OutInfo(); }
private Pupil RandomPupil() { Pupil tmp = new BadPupil(); switch (rand.Next(1, 4)) { case 1: tmp = new GoodPupil(); break; case 2: tmp = new ExcelentPupil(); break; case 3: tmp = new BadPupil(); break; } return(tmp); }
static void Main(string[] args) { Pupil pupil1 = new BadPupil(); Pupil pupil2 = new GoodPupil(); ClassRoom class1A = new ClassRoom(pupil1, pupil2); class1A.Read(); Console.WriteLine(new string('*', 30)); class1A.Stady(); Console.WriteLine(new string('*', 30)); class1A.Write(); Console.WriteLine(new string('*', 30)); class1A.Relax(); Console.WriteLine(new string('*', 30)); Console.ReadKey(); }