예제 #1
1
        public static void Main()
        {
            SchoolClass physics = new SchoolClass("physics");

            Teacher pesho = new Teacher("Pesho");
            physics.AddTeacher(pesho);

            Teacher gosho = new Teacher("Gosho");
            physics.AddTeacher(gosho);

            Teacher tosho = new Teacher("Tosho");
            physics.AddTeacher(tosho);
            tosho.AddComment("I am a comment");

            Student ivan = new Student("Vanko", "009");
            physics.Students.Add(ivan);

            Student petko = new Student("Pecata", "003");
            physics.Students.Add(petko);

            School mySchool = new School();
            mySchool.Classes.Add(physics);

            foreach (var teacher in mySchool.Classes[0].Teachers)
            {
                Console.WriteLine(teacher.Name);
                Console.WriteLine(string.Join(", ", teacher.Comments));
            }

            foreach (var student in mySchool.Classes[0].Students)
            {
                Console.WriteLine(student.Name);
                Console.WriteLine(string.Join(", ", student.Comments));
            }
        }
예제 #2
0
파일: Demo.cs 프로젝트: simeonemanuilov/OOP
        public static void Main()
        {
            Student simeon = new Student("Simeon", 1290122);
            Student petko = new Student("Petko", 1290871);
            Student joro = new Student("Joro", 1294424);

            Discipline java = new Discipline("Java", new HashSet<Student>() { simeon, petko }, 15);
            Discipline php = new Discipline("PHP", new HashSet<Student>() { petko, joro }, 10);

            Teacher nakov = new Teacher("Nakov", new HashSet<Discipline>() { java, php });
            Teacher karamfilov = new Teacher("Karamfilov", new HashSet<Discipline>() { php }, "Very punctual!");

            Class schClass = new Class("Robotics", new HashSet<Teacher>() { nakov, karamfilov }, new HashSet<Student>() { simeon, petko, joro });
            School MIT = new School(new HashSet<Class>() { schClass });
        }        
        static void Main(string[] args)
        {
            Student dani = new Student("Daniel", 19, 1233654789, "ambicious");
            Student vili = new Student("Vili", 19, 12323141231);

            IList<Student> students = new List<Student>() { dani, vili };

            Discipline math = new Discipline("mathemarics", 15, students, "hard...");

            Teacher minkova = new Teacher("Minkova", 45, new List<Discipline>() { math }, "very bad");

            Class september = new Class(students, new List<Teacher>() { minkova }, "September #2");

            School softUni = new School(new List<Class>() { september });

        }
예제 #4
-1
파일: Demo.cs 프로젝트: bnaskov/SoftUni
        public static void Main()
        {
            Student ivan = new Student("Ivan", 1234567);
            Student george = new Student("George", 1290871);
            Student ani = new Student("Ani", 1290432);
            // Student mike = new Student("mike", 1290871);

            Discipline java = new Discipline("Java", new HashSet<Student>() { ivan, george }, 15);
            Discipline php = new Discipline("PHP", new HashSet<Student>() { ivan, ani }, 10);

            Teacher nakov = new Teacher("Nakov", new HashSet<Discipline>() { java, php });
            Teacher karamfilov = new Teacher("Karamfilov", new HashSet<Discipline>() { php }, "Very punctual!");

            Class schClass = new Class("Robotics", new HashSet<Teacher>() { nakov, karamfilov }, new HashSet<Student>() { ivan, george, ani });
            School MIT = new School(new HashSet<Class>() { schClass });
        }