Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            // read students
            var            provider = GetStudentsProvider();
            List <Student> students = provider.GetStudents();

            var university = new University("CH.U.I.");

            // add students to university
            university.AddStudents(students);
            Console.WriteLine("List of all students:");
            Console.WriteLine(string.Join(", ", students.Select(x => x.Name)));

            // create intership with minimal level of knowlenge for student
            var internship = new Internship("Interlink", university.GetAverageStudentsLevel());

            internship.ApplyToInternship(students);

            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var s = new Student("Alex");

            s.SetKnowledge(new Knowledge(5));
            University university = new University("CH.U.I.");
            University universityWithoutStudents = new University("Sad university");

            university.AddStudent(new Student("Andrew Kostenko", new Knowledge(5)));
            university.AddStudent(new Student("Julia Veselkina", new Knowledge(4)));
            university.AddStudent(new Student("Maria Perechrest", new Knowledge(3)));
            university.AddStudent(new Student("Roma Danilyk", new Knowledge(4)));
            university.AddStudent(new Student("Oleg Pilipenko", new Knowledge(3)));
            university.AddStudent(s);
            Internship internship = new Internship("Interlink");

            internship.SelectStudents(university);
            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());

            Console.WriteLine(universityWithoutStudents.GetAverageKnowledge());
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            FileStream fs = new FileStream("candidates.xml", FileMode.OpenOrCreate);
            var        s1 = new Student("Ivan", new Knowledge(80));
            var        s2 = new Student("Dany", new Knowledge(0));
            var        s3 = new Student("Mark", new Knowledge(100));

            Student[]     stud      = new Student[] { s1, s2, s3 };
            XmlSerializer formatter = new XmlSerializer(typeof(Student[]));

            using (fs)
            {
                formatter.Serialize(fs, stud);
            }

            var s = new Student("Alex");

            University university = new University("CH.U.I.");

            university.AddStudent(new Student("Andrew Kostenko", new Knowledge(80)));
            university.AddStudent(new Student("Julia Veselkina", new Knowledge(70)));
            university.AddStudent(new Student("Maria Perechrest", new Knowledge(60)));
            s.SetKnowledge(new Knowledge(80));


            Internship internship = new Internship("Interlink");

            foreach (var student in university.students)
            {
                internship.candidates.Add(student);
            }
            internship.candidates.Add(s);
            internship.GetCandidatesFrom(fs = new FileStream("candidates.xml", FileMode.OpenOrCreate));

            internship.GetStudents(university, internship.candidates);
            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.ShowBestStudents());
            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            //var s = new Student("Alex");

            //IStrategy strategy = new GetStudentsFromDB();
            //University university = new University("CH.U.I.");
            //university.Strategy = strategy;
            //university.AddStudent();

            University university = new University("CH.U.I.");

            university.AddStudent(new Student("Andrew Kostenko", new Knowledge(1111)));
            university.AddStudent(new Student("Julia Veselkina", new Knowledge(160)));
            university.AddStudent(new Student("Maria Perechrest", new Knowledge(180)));
            university.AddStudent(new Student("Alex", new Knowledge(180)));

            Internship internship = new Internship("Interlink");

            internship.AddUniversity(university);
            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            var        s          = new Student("Alex", new Knowledge(5));
            University university = new University("CH.U.I.");

            university.AddStudent(new Student(("Andrew Kostenko"), new Knowledge(3)));
            university.AddStudent(new Student(("Julia Veselkina"), new Knowledge(4)));
            university.AddStudent(new Student(("Maria Perechrest"), new Knowledge(5)));

            University university2 = new University("CH.D.T.U");

            university2.AddStudent(new Student(("Prokopenko Serj"), new Knowledge(5)));
            university2.AddStudent(new Student(("Julia Vereschagina"), new Knowledge(4)));
            university2.AddStudent(new Student(("Peter Parker"), new Knowledge(5)));

            Internship internship = new Internship("Interlink");

            internship.AddUniversity(university);
            internship.AddUniversity(university2);
            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            List <Student> students = GetStudents();

            University university = new University("CH.U.I.");

            foreach (var stud in students)
            {
                university.AddStudent(stud);
            }

            Internship internship = new Internship("Interlink");

            foreach (var stud in university.Students)
            {
                internship.SetStudent(stud);
            }

            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());

            Console.ReadKey();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            var student1 = new Student("Viktoriia Pavliuk");

            student1.SetKnowledge(new Knowledge(88));

            var student2 = new Student("Vitaliy Datsyshyn");

            student2.SetKnowledge(new Knowledge(89));

            var student3 = new Student("Petro Beckham");

            student3.SetKnowledge(new Knowledge(47));

            var student4 = new Student("Natalie Dormer");

            student4.SetKnowledge(new Knowledge(70));

            var LPNU = new University("LP NU");

            LPNU.AddStudent(student1);
            LPNU.AddStudent(student2);
            LPNU.AddStudent(student3);
            LPNU.AddStudent(student4);

            IReader reader = new ConsoleReader();

            LPNU.AddStudents(reader.ReadStudents());

            var internship = new Internship("InterLink");

            internship.AddStudentsFromUniversity(LPNU);

            IWriter writer = new ConsoleWriter();

            writer.WriteStudents(internship.GetStudents());
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Student s1 = new Student("Alex Kostenko");
            Student s2 = new Student("Maria Veselkina");
            Student s3 = new Student("Julia Prechrest");
            Student s4 = new Student("Andriy Vorochinsky");
            Student s5 = new Student("Vladyslav Machete");

            s1.SetKnowledge(new Knowledge(20));
            s2.SetKnowledge(new Knowledge(38));
            s3.SetKnowledge(new Knowledge(54));
            s4.SetKnowledge(new Knowledge(84));
            s5.SetKnowledge(new Knowledge(46));


            University university1 = new University("CH.U.I.");

            university1.AddStudent(s1);
            university1.AddStudent(s2);
            university1.AddStudent(s3);

            University university2 = new University("L.N.U");

            university2.AddStudent(s4);
            university2.AddStudent(s5);

            Internship internship = new Internship("Interlink");

            internship.ApplyStudent(s1);
            internship.ApplyStudent(s2);
            internship.ApplyStudent(s3);
            internship.ApplyStudent(s4);
            internship.ApplyStudent(s5);
            Console.WriteLine("List of internship's students:");
            Console.WriteLine(internship.GetStudents());
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            /*
             * University universityA = new University("CHDTU");
             * var student1 = new Student("Andrew Kostenko", new Knowledge(78));
             * var student2 = new Student("Julia Veselkina", new Knowledge(92));
             * var student3 = new Student("Maria Perechrest", new Knowledge(60));
             * universityA.AddStudent(student1);
             * universityA.AddStudent(student2);
             * universityA.AddStudent(student3);
             *
             * Internship internLink = new Internship("Interlink");
             * internLink.AddStudent(student1, universityA);
             *          internLink.AddStudent(student2, universityA);
             *          internLink.AddStudent(student3, universityA);
             *          Console.WriteLine("List of internship's students:");
             * Console.WriteLine(internLink.GetStudents());
             */
            var        student1    = new Student("Andrew Kostenko", new Knowledge(60, 60), 0.5f, true);
            var        student2    = new Student("Andrew NeKostenko", new Knowledge(60, 60), 0.5f, true);
            var        student3    = new Student("NeAndrew Kostenko", new Knowledge(60, 60), 0.5f, false);
            var        student4    = new Student("NeAndrew NeKostenko", new Knowledge(60, 60), 0.5f, true);
            University universityA = new University("CHDTU");

            universityA.AddStudent(student1);
            universityA.AddStudent(student2);
            universityA.AddStudent(student3);
            universityA.AddStudent(student4);
            University universityB = new University("CHNU");

            universityB.AddStudent(student4);
            Internship internLink = new Internship("Interlink");

            internLink.AddStudent(student1, universityA);
            internLink.AddStudent(student2, universityA);
            internLink.AddStudent(student3, universityB);
            internLink.AddStudent(student4, universityB);
            Meetup     meetup     = new Meetup("Митап");
            selfTaught selfTaught = new selfTaught();

            ISchedule workingDays        = new DoWSchedule(DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Tuesday, DayOfWeek.Friday);
            ISchedule weekends           = new DoWSchedule(DayOfWeek.Saturday, DayOfWeek.Sunday);
            ISchedule everyDays          = new JoinSchedule(workingDays, weekends);
            ISchedule excludeSummer      = new MonthSchedule(1, 2, 3, 4, 5, 9, 10, 11, 12);
            ISchedule academicSchedule   = new JoinSchedule(excludeSummer, workingDays);
            ISchedule daysInLastWInMonth = new LastWoMSchedule(DayOfWeek.Friday);


            Plan pacificPlan = new Plan("Пацифист");

            pacificPlan.addTask(universityA, new Period(new DateTime(2015, 9, 1), new DateTime(2020, 7, 20)), academicSchedule);
            pacificPlan.addTask(universityB, new Period(new DateTime(2020, 9, 1), new DateTime(2022, 7, 20)), academicSchedule);

            Plan selfTaughtPlan = new Plan("Самоучка");

            selfTaughtPlan.addTask(internLink, new Period(new DateTime(2018, 9, 1), new DateTime(2020, 7, 20)), workingDays);
            selfTaughtPlan.addTask(meetup, daysInLastWInMonth);
            selfTaughtPlan.addTask(selfTaught, everyDays);

            Plan teachMEPlan = new Plan("Терпила");

            teachMEPlan.addTask(universityA, new Period(new DateTime(2018, 9, 1), new DateTime(2020, 7, 20)), academicSchedule);
            teachMEPlan.addTask(meetup, new Period(new DateTime(2018, 9, 1), new DateTime(2020, 7, 20)), daysInLastWInMonth);
            teachMEPlan.addTask(new Period(new DateTime(2018, 9, 1), new DateTime(2020, 7, 20)), everyDays);

            Plan enlightenedPlan = new Plan("Сознательный");

            enlightenedPlan.addTask(universityA, new Period(new DateTime(2015, 9, 1), new DateTime(2020, 7, 20)), academicSchedule);
            enlightenedPlan.addTask(meetup, daysInLastWInMonth);
            enlightenedPlan.addTask(internLink, new Period(new DateTime(2018, 9, 1), new DateTime(2020, 7, 20)), workingDays);
            enlightenedPlan.addTask(selfTaught, everyDays);
            enlightenedPlan.addTask(student2, weekends);

            pacificPlan.teachStudent(student1, new Period(new DateTime(2015, 9, 1), new DateTime(2022, 7, 20)));
            selfTaughtPlan.teachStudent(student2, new Period(new DateTime(2015, 9, 1), new DateTime(2022, 7, 20)));
            teachMEPlan.teachStudent(student3, new Period(new DateTime(2015, 9, 1), new DateTime(2022, 7, 20)));
            enlightenedPlan.teachStudent(student4, new Period(new DateTime(2015, 9, 1), new DateTime(2022, 7, 20)));

            Console.WriteLine(student1.GetKnowledgePract() + " " + student1.GetKnowledgeTheory());
            Console.WriteLine(student2.GetKnowledgePract() + " " + student2.GetKnowledgeTheory());
            Console.WriteLine(student3.GetKnowledgePract() + " " + student3.GetKnowledgeTheory());
            Console.WriteLine(student4.GetKnowledgePract() + " " + student4.GetKnowledgeTheory());
        }