static void Main()
        {
            Department cs = new Department();
            Random rnd = new Random();
            List<Student> present = new List<Student>();
            for (int i = 0; i < 13; i++)
            {
                string studName = name[rnd.Next(0, 16)];
                int fn = int.Parse(string.Concat("12", rnd.Next(3150, 4217)));
                Student next = new Student(studName, fn, cs);
                if (!present.Contains(next))
                {
                    present.Add(next);
                }
            }

            cs.Announce();
            Console.WriteLine("List of present students:");
            foreach (Student man in present)
            {
                Console.WriteLine(string.Join(", ", man.Name, man.FacultyNumber));
            }
        }
Beispiel #2
0
 private List<Student> Inscribe(Student customStudent)
 {
     examList.Add(customStudent);
     return examList;
 }