#include using namespace std; class WebPage; class ItLinks { private: int IndexTerm; // Web page id WebPage* wplink; // Pointer to web page public: }; class WebPage { private: int wpnumber; // Web page id WebPage* nextwp; // Pointer to web page ItLinks itl[3]; //Index terms Links public: }; class WebList { private: WebPage* first; // Pointer to first web page in list int number; // Total number of web pages in list public: }; class IndexTerm { private: int itnumber; //Index term id int numberoftimes; //# of web pages that include itnumber WebPage* link2webpage; //Pointer to web page IndexTerm* nextit; //Pointer to index term public: }; class ITList { private: IndexTerm* first; // Pointer to index term in list int number; // Total number of (different) index terms public: }; // The following function takes as input a pointer to the first element // in the web pages list and an integer m and returns a pointer to the // instance of struct webpage that represent web page m, or NULL (zero) // if the web page is not in the list. int main(void) { int m,i1,i2; char t; // ... while(1==1) {cin.get(t); switch(t) { case('i'): {cin >> m >> i1 >> i2; cout << "i " << m << " " << i1 << " " << i2 << endl; /* Should invoke a function to insert a web page*/ break;} case('d'): {cin >> m; cout << "d " << m << endl; /* Should invoke a function to delete a web page */ break;} // ... case('l'): {cout << "l" << endl; /* Should invoke a function to print the correct number */ break;} // ... case('q'): {cout << "l" << endl; // need to delete lists exit(0);} } cin.get(t); if('\n' != t) exit(1); } }