示例#1
0
 public ClassRoom(Pupil p0, Pupil p1)
 {
     pupils[0] = p0;
     pupils[1] = p1;
     pupils[2] = new BadPupil();
     pupils[3] = new ExcelentPupil();
 }
示例#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();
        }
示例#3
0
        public override void Write()
        {
            base.Write();
            Console.Write("- пишут: ");
            int sum = 0;

            for (int i = 0; i < pupils.Length; i++)
            {
                if (excelentPupil == base.pupils[i])
                {
                    sum++;
                    ExcelentPupil excelentPupil = new ExcelentPupil(pupilOne, pupilTwo, pupilThree, pupilFour);
                    Console.Write(excelentPupil.pupils[i] + ", ");
                }
                if (i != (pupils.Length - 1))
                {
                    continue;
                }
                else if (excelentPupil != base.pupils[i] && sum == 0)
                {
                    Console.Write("No one");
                }
            }
            Console.WriteLine();
        }
示例#4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Pupil test1 = new Pupil("Ivanov");
            Pupil test2 = new ExcelentPupil("Smith");
        }
示例#5
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();
 }
示例#6
0
        public void ExcelentPupils()
        {
            ExcelentPupil excelentPupil = new ExcelentPupil(pupilOne, pupilTwo, pupilThree, pupilFour);

            excelentPupil.Study();
            excelentPupil.Read();
            excelentPupil.Write();
            excelentPupil.Relax();
        }
示例#7
0
文件: Program.cs 项目: Stargik/C-Base
        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();
        }
示例#8
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();
        }
示例#9
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();
        }
示例#10
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();
        }