/*--- inherit.cpp -----------------------------------------------------
  Program to test the ExtendedVector class template.
 
  Written by:   Larry R. Nyhoff
   
  Written for:  Lab Manual for ADTs, Data Structures, and Problem
                Solving with C++, 2E

                           Lab #12.1
                                                          
  Add your name here and other info requested by your instructor.

 ---------------------------------------------------------------------*/

#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 << "extVec's capacity = " << extVec.capacity()
       << "\nand its size = " << extVec.size() << endl;
*/


// ---- SECTION 2 -- Other inherited operations
/*
  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 with some elements added and modified\n"; 
  for (int i = 0; i < 5; i++)
    cout << extVec[i] << "  ";
  cout << endl;
  cout << "Its capacity = " << extVec.capacity() << endl;
  cout << "Its size = " << extVec.size() << endl;
*/

// ---- SECTION 3 -- I/O
/*
  cout << "\n--- Section 3: I/O ---\n";

  cout << "Checking << with extVec:  It gives\n"
       << extVec << endl;

  cout << "Now checking >> with newExtVec:\n";
  ExtendedVector<double> newExtVec;
  cout << "Enter an extended vector (newExtVec):\n";
  cin >> newExtVec;
  cout << "Contents of newExtVec:\n" << newExtVec << endl;
*/


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


// ---- SECTION 5 -- isSorted()
/*
  cout << "\n--- Section 5: Checking isSorted() ---\n";
  cout << "Is extVec sorted?  " 
       << (extVec.isSorted() ? "yes" : "no") << endl;
  cout << "Is newExtVec sorted?  " 
       << (newExtVec.isSorted() ? "yes" : "no") << endl;
  cout << "What about nyetExtVec?  " 
       << (nyetExtVec.isSorted() ? "yes" : "no") << endl;
*/


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

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

*/


// ---- SECTION 7 -- Linear Search
/*
   cout << "\n--- Section 5: Linear Search ---\n"; 
   ExtendedVector<double> searchVec; 
   for (int i = 1; i <= 8; i++)
     if (i % 2 == 0) 
       searchVec.push_back(i);
     else
       searchVec.push_back(10 - i);
   searchVec.push_back(11.1);
   searchVec.push_back(22.2);

   double value; 

   cout << "We will search for values in\n" << searchVec << endl;
   do
   { 
     cout << "Enter a value to search for: ";
     cin >> value; 
     int loc = searchVec.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 pos;

  do
  {
    cout << "Enter the position where you want to insert a value: ";
    cin >> position;
    cout << "Enter the value to insert: ";
    cin >> value;
    newExtVec.insert(pos, 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');
*/
}

