#include #include "BnSearch.cpp" #define SIZE 5 int bin_search (const apvector &, //IN: the array being searched int target); //IN: the target being sought int main() { apvector items(SIZE); // IN: Array to search int target; // IN: Target to search for int target_index; // OUT: Index of target element //Read array elements cout << "Enter " << SIZE << " integers in ascending order separated by a space: "; for (int i = 0; i < items.length(); i++) cin >> items[i]; //Read target value cout << endl << "Enter item to search for: "; cin >> target; //Search array for target value target_index = bin_search (items, target); //Display location of target if (target_index != -1) cout << endl << "The target is located at position " << target_index << "."; else cout << endl << "The target was not found."; return 0; }