#include <fstream.h>
#include <set>
#include "customer.h"

typedef set<Customer> SC;

main(int argc, char *argv[])
{
  ifstream in;
  SC s;
  Customer temp;

  in.open(argv[1]);

  in >> temp;
  while(in) {
    s.insert(temp);
    in >> temp;
  }
  string menu;

  cout << "What class of customer do you want to see? ";
  cin >> menu;
  
  SC::iterator sitor,eitor;

  temp.SetAOB(100000);

  if (menu == "Platinum") {
    sitor = s.lower_bound(temp);
    eitor = s.end();
  }
  else if (menu == "Gold") {
    eitor = s.upper_bound(temp);
    temp.SetAOB(50000);
    sitor = s.lower_bound(temp);
  }

  for (SC::iterator i=sitor; i!=eitor; i++)
    cout << *i;

}


