// file: a1.cpp // this is the startup code for assignment 1 // *** include your name and other identification data here #include #include using namespace std; // the main program is doing the basic input/output of html file names and keywords // do not change the standard input format expected by the TA for marking int main() { int ndocs, nkeyws, // number of html docs and number of keywords i; // read document file info cout << "Enter Number of Documents> "; cin >> ndocs; // number of html documents string* docnames= new string[ndocs]; // array to store html document names, // (dynamically allocated) // read each document name for (i=0; i< ndocs; i++) { cout<< "Enter document "<< i+1<<" > "; cin >> docnames[i]; } // read keywords cout << "\nEnter Number of Keywords> "; cin >> nkeyws; string* keywords= new string[nkeyws]; // array to store keywords // (dynamically allocated) // read each keywords for (i=0; i< nkeyws; i++) { cout<< "Enter keyword "<< i+1<<" > "; cin >> keywords[i]; } /*** lots have to be done here/called here ***/ cout << "\n\n********************** Search redults ***********************\n\nhtml documents: "; for (i=0; i< ndocs-1; i++) cout<< docnames[i]<<", "; cout << docnames[ndocs-1]<<"\n"; cout << "\nkeywords: "; for (i=0; i< nkeyws-1; i++) cout<< keywords[i]<<", " ; cout << keywords[nkeyws-1]<<"\n"; cout << "\nresults:\n\n"; /*** results have to be printed here ***/ delete[] docnames; delete[] keywords; return 0; }