public static void Main()
Parent p1 = new Parent("yosi", "099999999");
Student s1 = new Student("Bob", "000000000", p1);
Parent p2 = new Parent("yosi", "099999999");
Student s2 = new Student("Bob", "000000000", p2);
Parent p3 = new Parent("yosi", "099999999");
Student s3 = new Student("Bob", "000000000", p3);
StudentList stList = new StudentList();
public Parent(string name, string cellNum)
public string GetCellNum()
public void SetCellNum(string newCellNum)
this.cellNum = newCellNum;
public Student(string name, string phoneNum, Parent parent)
this.phoneNum = phoneNum;
public Student(Student st)
this.phoneNum = st.phoneNum;
public string GetPhoneNum()
public void SetPhoneNum(string phoneNum)
this.phoneNum = phoneNum;
public Parent GetParent()
public override string ToString()
return (this.name + " ," + this.phoneNum + "\n");
public const int MAX_STUDENTS = 35;
this.list = new Student[MAX_STUDENTS];
private int FindStudent(string name)
for (i = 0; i < this.lastPosition; i++)
if (this.list[i].GetName() == name)
private void MoveOthersBack(int k)
for (int i = k + 1; i < this.lastPosition; i++)
this.list[i - 1] = this.list[i];
private void MoveOthersForward(int k)
for (j = this.lastPosition; j > k; j--)
this.list[j] = list[j - 1];
public void Add(Student st)
this.list[lastPosition++] = st;
public string Del(string name, StudentList list)
if(list.FindStudent(name) == -1)
list.MoveOthersBack(lastPosition)