/* inherit.cpp is used to test the ExtendedVector class template:
 *
 * Written by:   Larry R. Nyhoff
 * Written for:  Lab Manual for C++: An Introduction to Data Structures
 *
 * Add other documentation required by your instructor such as your name, 
 * course number, and the current date.
 *************************************************************************/

#include <iostream>
using namespace std;

#include "ExtendedVector.h"

typedef int NothingYet;

int main()
{

// ---- SECTION 1 -- Constructor
/*
  cout << "\n--- Section 1:  Construction ---\n";
  ExtendedVector<double> extVec;

  cout << "Capacity = " << extVec.capacity() << endl;
  cout << "Size = " << extVec.size() << endl;
*/


// ---- SECTION 2 -- Other inherited operations
/*
  cout << "\n--- Section 1:  Construction ---\n";

  cout << "\n--- Section 2:  Inherited Ops ---\n";
  for (int i = 1; i <= 5; i++)
    extVec.push_back(10*i);
  extVec.front() = 1.2345;
  extVec.pop_back();
  extVec.push_back(99.9);
  extVec[2] = 22.2;
  cout << "Here is extVec: ";
  for (int i = 0; i < 5; i++)
    cout << extVec[i] << "  ";
  cout << endl;
  cout << "Capacity = " << extVec.capacity() << endl;
  cout << "Size = " << extVec.size() << endl;
*/

// ---- SECTION 3 -- I/O
/*
  cout << "\n--- Section 3: I/O ---\n";
  ExtendedVector<double> newExtVec;

// For input:  Add appropriate prompts here or have your
//             overloaded >> do so.

  cin >> newExtVec;
  cout << "Contents of newExtVec: " << newExtVec << endl;
*/


// ---- SECTION 4 -- LEqDefined() accessor
/*
  cout << "Are < and = defined for extVec? " 
       << (extVec.LEqDefined() ? "yes" : "no") << endl;
  cout << "Are < and = defined for nyetExtVec? " 
       << (nyetExtVec.LEqDefined() ? "yes" : "no") << endl;
*/


// ---- SECTION 5 -- Sorted()
/*
  cout << "Is extVec sorted? " 
       << (extVec.Sorted() ? "yes" : "no") << endl;
  cout << "Is newExtVec sorted? " 
       << (newExtVec.Sorted() ? "yes" : "no") << endl;
  cout << "What about nyetExtVec? " 
       << (nyetExtVec.LEqDefined() ? "yes" : "no") << endl;
*/


// ---- SECTION 6 -- Sort()
/*
  char response;
  cout << "Do you want to sort newExtVec (Y or N)? ";
  cin >> response;
  if (response == 'y' || response == 'Y')
  {
    cout << "Sorting newExtVec:\n ";
    newExtVec.Sort();
    cout << newExtVec << endl;
  }

  cout << "Trying to sort nyetExtVec:\n ";
  nyetExtVec.Sort();

*/


// ---- SECTION 7 -- Linear Search
/*
  cout << "\n--- Section 5: Linear Search ---\n";
  double value;
  char response;

  do
  {
    cout << "Enter a value to search for in this last extended vector: ";
    cin >> value;
    int loc = newExtVec.LinearSearch(value);
    if (loc >= 0)
      cout << value << " found at location " << loc << endl;
    else
      cout << value << " not found\n";
    cout << "More searching (Y or N)? ";
    cin >> response;
  }
  while (response == 'Y' || response == 'y');
*/


// ---- SECTION 8 -- Insert
/*
  cout << "\n--- Section 6: Insert ---\n";
  int loc;

  do
  {
    cout << "Enter a location and value to insert there: ";
    cin >> loc >> value;
    newExtVec.insert(loc, value);
    cout << "New Extended Vector: " << newExtVec << "\n\n";
    cout << "More inserts (Y or N)? ";
    cin >> response;
  }
  while (response == 'Y' || response == 'y');
*/


// ---- SECTION 9 -- Erase
/*
  cout << "\n--- Section 7: Erase ---\n";

  do
  {
    cout << "Enter a value to remove: ";
    cin >> value;
    newExtVec.erase(value);
    cout << "Vector now is: " << newExtVec << "\n\n";
    cout << "More removals (Y or N)? ";
    cin >> response;
  }
  while (response == 'Y' || response == 'y');
*/
}


