Exemplo n.º 1
0
        public override void Read()
        {
            base.Read();
            Console.Write("- читают: ");
            int sum = 0;

            for (int i = 0; i < pupils.Length; i++)
            {
                if (badPupil == base.pupils[i])
                {
                    sum++;
                    BadPupil badPupil = new BadPupil(pupilOne, pupilTwo, pupilThree, pupilFour);
                    Console.Write(badPupil.pupils[i] + ", ");
                }
                if (i != (pupils.Length - 1))
                {
                    continue;
                }
                else if (badPupil != base.pupils[i] && sum == 0)
                {
                    Console.Write("No one");
                }
            }
            Console.WriteLine();
        }
Exemplo n.º 2
0
        public void BadPupils()
        {
            BadPupil badPupil = new BadPupil(pupilOne, pupilTwo, pupilThree, pupilFour);

            badPupil.Study();
            badPupil.Read();
            badPupil.Write();
            badPupil.Relax();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ExcelentPupil excelentPupil = new ExcelentPupil();
            GoodPupil     goodPupil     = new GoodPupil();
            BadPupil      badPupil      = new BadPupil();
            ClassRoom     classRoom     = new ClassRoom(excelentPupil, goodPupil, badPupil);

            classRoom.GetInformation();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Pupil         p1            = new Pupil();
            Pupil         p2            = new Pupil();
            Pupil         p3            = new Pupil();
            ClassRoom     classRoom     = new ClassRoom(p1, p2, p3);
            ExcelentPupil excelentPupil = new ExcelentPupil();
            GoodPupil     goodPupil     = new GoodPupil();
            BadPupil      badPupil      = new BadPupil();

            p1.Read();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Pupil firstPupil  = new ExcelentPupil();
            Pupil secondPupil = new GoodPupil();
            Pupil thirdPupil  = new ExcelentPupil();
            Pupil fourthPupil = new BadPupil();

            ClassRoom classRoom = new ClassRoom(firstPupil, secondPupil, thirdPupil, fourthPupil);

            foreach (Pupil p in classRoom.Pupils)
            {
                p.Descr();
                p.Study();
                p.Read();
                p.Write();
                p.Relax();
                Console.WriteLine();
            }

            Console.ReadLine();
        }