Professional Documents
Culture Documents
#include "List.h"
using namespace std;
void main()
{
int item;
int position;
List ItemList;
if (ItemList.numberOfItem() == 0)
{
cout << "No elements at this list\n";
}
cout << "Now there are : " << ItemList.numberOfItem() << " item in the
list\n\n";
//display total
ItemList.total();
//search data
int target;
int locationWanted;
bool found = false;
cout << "Insert a target: ";
cin >> target;
do
{
found = ItemList.findItem(target, locationWanted);
if (found)
cout << "\tFound " << target << " at index "
<< locationWanted << endl;
else
cout << "\tTarget not found" << endl;
cout << "\nInsert a target, or 0 to stop: ";
cin >> target;
} while (target != 0);