static int LinearSearch(item[] array, int target) { for (int i = 0; i < array.Length; i++) { if (array[i].quantity == target) { return i; } } return -1; }