Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Base
- {
- class Group
- {
- public List<Student> Grop;
- public int numgroup, course;
- public Group(List<Student> som)
- {
- Grop = som;
- }
- public void Add(Student a)
- {
- Grop.Add(a);
- }
- public void Del(string z)
- {
- int c = 0;
- foreach (Student n in Grop)
- {
- bool res = true;
- if (n.name.Length == z.Length)
- {
- for(int i = 0; i <z.Length; i++)
- {
- if (n.name[i] != z[i])
- {
- res = false;
- }
- }
- }
- else
- {
- res = false;
- }
- if (res)
- {
- Grop.RemoveAt(c);
- c--;
- }
- c++;
- }
- }
- public void showgroup()
- {
- Console.WriteLine("Number of group: {0}. Course: {1}. Size of group: {3}", numgroup, course, Grop.Count());
- }
- public void showstudents()
- {
- Console.WriteLine("Student of {0} group: ", numgroup);
- foreach(Student a in Grop)
- {
- Console.WriteLine("Student {0} {1}, Stud ticket is {2}", a.name, a.surname, a.stnum);
- }
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement