public void Insert(string input, int index) //вставка в заданный пользователем индекс { if (index < counter) { for (int i = counter; i >= index; i--) { customers[i + 1] = customers[i]; } customers[index] = new Orderer(input); counter++; } else { if (index == counter || index > counter && index < size) { Add(input); counter++; } } }
public void Add(string name)//операция добавления { counter++; customers[counter] = new Orderer(name); }
public Shop() { size = 25; customers = new Orderer[size]; counter = -1; }