// ListType.cpp

// implementation file

//Lab #04 Section #2


#include "ListType.h"
#include <iostream>
#include <string>
using namespace std;
 
void printMenu()
{
  cout << "---Menu---" << endl << "1.  Add a word to the list" << endl
    << "2.  Remove a word from the list" << endl
  << "3.  Print the list" << endl
  << "9.  Quit" << endl << "Your Choice (1, 2, 3, or 9) ===> ";
}

int main()
{
  ListType a;
  int choice;
  string word;
  
  printMenu();
  cin >> choice;  
  while(choice != 9)
  {
    switch(choice)
    {
    case 1:
      cout << "Enter a word to add: ";
      cin >> word;
      a.add(word);
      break;
    case 2:
      cout << "Enter a word to remove: ";
      cin >> word;
      a.remove(word);
      break;
    case 3:
      a.print();
      break;
    default :
      cout << "Error:  Incorrect input" << endl;
      break;
    }
 printMenu();
cin >> choice;
  }
}

