Ejemplo n.º 1
0
        public override void Write()
        {
            base.Write();
            Console.Write("- пишут: ");
            int sum = 0;

            for (int i = 0; i < pupils.Length; i++)
            {
                if (goodPupil == base.pupils[i])
                {
                    sum++;
                    GoodPupil goodPupil = new GoodPupil(pupilOne, pupilTwo, pupilThree, pupilFour);
                    Console.Write(goodPupil.pupils[i] + ", ");
                }
                if (i != (pupils.Length - 1))
                {
                    continue;
                }
                else if (goodPupil != base.pupils[i] && sum == 0)
                {
                    Console.Write("No one");
                }
            }
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ExcelentPupil excelentPupil = new ExcelentPupil("S***n");
            BadPupil      badPupil      = new BadPupil("Stas");
            GoodPupil     goodPupil     = new GoodPupil("Leha");
            GoodPupil     goodPupil2    = new GoodPupil("Vasya");

            goodPupil.Study(4);
            goodPupil.Read(4);
            goodPupil.Write(4);
            goodPupil.Relax(3);

            goodPupil2.Study(4);
            goodPupil2.Read(4);
            goodPupil2.Write(4);
            goodPupil2.Relax(3);

            excelentPupil.Study(5);
            excelentPupil.Read(5);
            excelentPupil.Write(5);
            excelentPupil.Relax(2);

            badPupil.Study(2);
            badPupil.Read(2);
            badPupil.Write(2);
            badPupil.Relax(5);

            ClassRoom classRoom = new ClassRoom(goodPupil, goodPupil2, badPupil);

            classRoom.pupilsClass.Add(excelentPupil);
            classRoom.Show();
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     ExcelentPupil excelent = new ExcelentPupil("Masha", "Ivanovna", 12);
     GoodPupil good = new GoodPupil("Petya", "Petrov", 11);
     ClassRoom classRoom = new ClassRoom(excelent, good);
     classRoom.OutputInformation();
     Console.ReadLine();
 }
Ejemplo n.º 4
0
        public void GoodPupils()
        {
            GoodPupil goodPupil = new GoodPupil(pupilOne, pupilTwo, pupilThree, pupilFour);

            goodPupil.Study();
            goodPupil.Read();
            goodPupil.Write();
            goodPupil.Relax();
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Pupil     p1      = new ExcelentPupil("Ivan Ivanov");
            Pupil     p2      = new GoodPupil("Petr Zubov");
            ClassRoom class1A = new ClassRoom(p1, p2);

            class1A.Print();
            Console.ReadKey();
        }
Ejemplo n.º 7
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();
        }
Ejemplo n.º 8
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();
        }