#include "List.h"
#include <iostream>
using namespace
std;
int
main()
{
List ls;
int
choice = -1;
int
item = 0;
int
n = -1;
// Menu
do
{
cout <<
"1. Insert" << endl
<< "2.
Get" << endl
<< "3.
Erase " << endl
<< "4. Quit
" << endl
<< "Choice:
" << endl;
cin >>
choice;
if (
choice == 1 )
{
cout
<< "Enter an item: ";
cin
>> item;
ls.insert(
item );
cout
<< endl;
}
else if ( choice == 2 )
{
cout
<< "Which item shall I get: ";
cin
>> n;
item = ls.get( n );
cout
<< "Item number " << n << " is " <<
item << endl;
}
else if ( choice == 3 )
{
cout
<< "Which item shall I erase: ";
cin
>> n;
ls.erase(
n );
cout
<< "Item number " << n << " erased"
<< endl;
}
else if ( choice != 4 )
{
cout
<< "Unknown choice: " << choice << endl;
}
} while (
choice != 4 );
return 0;
}