예제 #1
0
파일: Program.cs 프로젝트: yanamikha/ISD_2
        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();
        }
예제 #2
0
        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);
        }
예제 #3
0
        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();
        }