Hi, I have some of the C++ code of my program already writtenbut I need to implement some little things to follow therequeriments.
My code already written:
#include <iostream>
#include <fstream>
#include <time.h>
#include <windows.h>
#include <list>
using namespace std;
const int Position_Table_Hash = 1000;
int FunctionHash(int iData)
{
return iData % 1000;
}
bool Find_Mat(list<int> List_Hash[Position_Table_Hash],int iData)
{
list<int>::iterator Beginnning =List_Hash[FunctionHash(iData)].begin();
list<int>::iterator End =List_Hash[FunctionHash(iData)].end();
while (Beginnning != End)
{
if (*Beginnning == iData)
return true;
++Beginnning;
}
return false;
}
int main()
{
int Search_ID, iData;
list<int> List_Hash[Position_Table_Hash];
ifstream File_Entry;
ofstream File_Exit;
cout << “What ID are you looking for?” << endl;
cin >> Search_ID;
clock_t startTime = clock();
File_Entry.open(“Search.txt”);
while (!File_Entry.eof())
{
File_Entry >> iData;
List_Hash[FunctionHash(iData)].push_back(iData);
}
Find_Mat(List_Hash, Search_ID) ? cout << “It is astudent.” << endl : cout << “It is not an student.”<< endl;
File_Exit.open(“Execution Time.txt”);
File_Exit <<
PayPal Gateway not configured
PayPal Gateway not configured