Example #1
0
int main(int argc, const char * argv[]) {
    
    Hash Hashy;
    string name = "";
    
    Hashy.AddItem("wutong", "beer");
    Hashy.AddItem("sunsining", "wine");

//    Hashy.PrintItemsInIndex(0);
//    while(name != "exit"){
//        cout << "Search for ";
//        cin >> name;
//        if(name != "exit"){
//            Hashy.FindDrink(name);
//        }
//    }
    Hashy.PrintTable();
    while(name != "exit"){
        cout << "Remove ";
        cin >> name;
        if(name != "exit"){
            Hashy.RemoveItem(name);
        }
    }
    
    Hashy.PrintTable();
    
    return 0;
}
Example #2
0
int main(int argc, char *argv[]) {
  Hash hashy;


  hashy.AddItem("192.168.0.1", 1, 1 * 1);
  hashy.AddItem("192.168.0.2", 2, 2 * 2);
  hashy.AddItem("192.168.0.3", 3, 3 * 4);
  hashy.AddItem("192.168.0.4", 4, 4 * 4);
  hashy.AddItem("192.168.0.5", 5, 5 * 5);
  hashy.AddItem("192.168.0.6", 6, 6 * 6);
  hashy.AddItem("192.168.0.7", 7, 7 * 7);
  hashy.AddItem("192.168.0.8", 8, 8 * 8);
  hashy.AddItem("192.168.0.9", 9, 9 * 9);
  hashy.AddItem("192.168.0.10", 10, 10 * 10);
  hashy.AddItem("192.168.0.11", 11, 11 * 11);

  //    cout << hashy.NumberOfItemsInIndex(2) << endl;

  hashy.PrintTable();

//  hashy.PrintItemsInIndex(2);

  cout << "findHopCount" << endl;
  functionTest(hashy, 0);

  cout << "removeHopCount "<< endl;
  functionTest(hashy, 1);

  //    hashy.Test();
  // hashy.PrintItemsInIndex(8);

  return 0;
}
Example #3
0
int main(int argc, char** argv)
{

	Hash Hashy;
	
	string name = "";
	
	Hashy.AddItem("Paul","malibu");
	Hashy.AddItem("Annie", "vodka");
	Hashy.AddItem("Emma", "rhum");
	Hashy.AddItem("Celine", "passoa");
	Hashy.AddItem("Robert", "beer");
	Hashy.AddItem("Jerem", "water");
	
	
	Hashy.PrintTable();
	/*
	Hashy.PrintItemsInIndex(5);
	Hashy.PrintItemsInIndex(2);
	Hashy.PrintItemsInIndex(4);
	*/

	while(name != "exit")
	{
		cout << "Remove for ";
		cin >> name;
		if(name != "exit")
			Hashy.RemoveItem(name);
	}
	
	
	return 0;
}